how to indicate different transferFcn in a same layer when using feedforwardnet

14 ビュー (過去 30 日間)
锦廷 丁
锦廷 丁 2022 年 3 月 2 日
編集済み: Krishna 2023 年 11 月 17 日
net = feedforwardnet([6 6 2]);
net.trainFcn='trainbr';
net.layers{1}.transferFcn='logsig';
net.layers{2}.transferFcn='tansig';
net.layers{3}.transferFcn='logsig';
net.layers{4}.transferFcn='tansig';
I know how to indicate transferFcn between two different layers.
how to indicate different transferFcn in a same layer but two different neuron

回答 (1 件)

Krishna
Krishna 2023 年 11 月 16 日
編集済み: Krishna 2023 年 11 月 17 日
Hello,
Based on your question, it seems like you want to use different activation functions for different neurons within the same hidden layer. Unfortunately, this is not possible when using the 'feedforwardnet.' Each hidden layer can only have one activation function.
By setting,
net.layers{1}.transferFcn = 'tansig'
you have assigned the tan sigmoid function to the neurons in the first hidden layer and so on.
I hope this explanation clarifies the situation for you.

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by