How to specify the transfer function for the hidden and output layer?

4 views (last 30 days)
I am using feedforwardnet to create a neural network. But this function takes only two arguments: the hidden layer sizes and the training function. I want to specify the transfer functions for each layer.

Accepted Answer

Greg Heath
Greg Heath on 8 Oct 2014
Use fitnet for regression/curve-fitting or patternnet for classification/pattern-recognition. Both call feedforwardnet.
2 layers are sufficient: 1 hidden + 1 output
Standardize(0-mean/unit-variance via zscore or mapstd) inputs and regression outputs.
Remove or modify outliers
Convert classification targets to 0-1 unit vectors via ind2vec
Accept the fitnet default transfer functions tansig/purelin
For classification the default tansig/softmax transfers are the better choice
The best way to choose initial weights and number of hidden nodes is via trial and error.
I have posted many double for loop examples. Search the NEWSGROUP and ANSWERS
greg fitnet Ntrials % for regression
greg patternnet Ntrials % for classification
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!