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

조회 수: 7 (최근 30일)
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?

답변 (1개)

Damien T
Damien T 2022년 12월 6일
편집: Damien T 2022년 12월 6일
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.

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by