How to change read only properties of Matlab Deep learning layers? (using approximation of sigmoid for LSTM Layer)

7 vues (au cours des 30 derniers jours)
I want to evaluate the accuracy if I change the activation functions of a BiLSTM-Network to different approximations.
Due this I constructed a network in Matlab.
For this, I want to change the activation functions of the BiLSTM-module of the network
For a minimal example, lets assume a network like this
numHiddenUnits = 100;
numClasses = 9;
layers = [ ...
sequenceInputLayer(inputSize)
bilstmLayer(numHiddenUnits)
fullyConnectedLayer(numClasses)
softmaxLayer
classificationLayer]
I want now to set for StateActivationFunction of the BiLSTM an approximation of the tanh function which I created by my own
if I open the struct and set another parameter it says me "its ready-only"
Has anybody an idea to avoid this?

Réponses (1)

Damien T
Damien T le 6 Déc 2022
Modifié(e) : Damien T le 6 Déc 2022
The LSTM layer in Matlab only supports tanh and softsign activations:
Moreover, you can only set this property when creating the layer. So you would have to create a new one, and replace the original layer with the new one in your layergraph or dlnetwork.

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by