NARX DNN: hidden layers and activation function
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi there, can you please tell me how to set the number of hidden layers and the activation function of the output layer in a NARX network? It seems that I can only use one hidden layer and the linear function in the output layer.
0 Commenti
Risposte (1)
Adarsh
il 23 Gen 2025
Hi,
I am assuming by NARX DNN you are referring to the “narxnet” Network. From what I found in the MATLAB documentation, in the “narxnet” Network the number of hidden layers in the Network can be modified by passing a row vector of one or more hidden layer sizes as input and as for the output layer activation function part you can access the last layer through the object handle of the “narxnet” object created and change its “transferFcn” property to any other function from “purelin” (linear activation). Here is an example code on how to use multiple hidden layers and modify output layer activation function:
net = narxnet(1:2,1:2,[10 2]); % Input delays, Feedback delays, Hidden layers row vector
[Xs,Xi,Ai,Ts] = preparets(net,XTrain,{},TTrain); % Preparing time series data
net.layers{end}.transferFcn = "logsig"; % Modifying the output layer activation function
net = train(net,Xs,Ts,Xi,Ai); % Train the network
Here is the link to the documentation section regarding the usage of “narxnet” with multiple hidden layers:
I hope it helps !
0 Commenti
Vedere anche
Categorie
Scopri di più su Deep Learning Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!