Filter löschen
Filter löschen

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

7 Ansichten (letzte 30 Tage)
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?

Antworten (1)

Damien T
Damien T am 6 Dez. 2022
Bearbeitet: Damien T am 6 Dez. 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.

Community Treasure Hunt

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

Start Hunting!

Translated by