Not expected weights size
Show older comments
I'm training a neural network with 25344 neurons in input layer, 64 neurons in hidden layer and 4 neurons in output layer. So i expect to get something like 25345x64 Theta1 and 65x4 Theta2, but getwb() returns me a 1622018x1 sized vector. What should i do to get Theta1 and Theta2 files of right sizes?
1 Comment
Greg Heath
on 26 May 2016
The nodes in the input layer are not neurons; they are fan-in units.
I have never heard of the notation Theta1 and Theta2. The standard MATLAB notations are
IW = net.IW;
b = net.b;
LW = net.LW;
Read the results of both the help and doc documentation commands on each of the functions
configure, getwb, setwb, formwb and separatewb
e.g.
help configure
doc formwb
Hope this helps.
Greg
Answers (1)
Greg Heath
on 27 May 2016
1. I have found the "I"nput and "O"utput target vector dimensions for the MATLAB NN EXAMPLE DATA SETS using the help and doc commands, i.e.,
help nndatasets
doc nndatasets
I then posted them in the NEWSREADER threads
www.mathworks.com/matlabcentral/newsreader/...
.../view_thread/337914 % Regression
.../view_thread/338208 % Timeseries
.../view_thread/339984 % Classification
2. Read both the help and doc documentations for functions
configure, getwb, setwb, formwb and separatewb
3. For a feedforward net with an I-H-O "I"nput-"H"idden-"O"utput node topology, the TOTAL number of weights is
Nw = (I+1)*H+(H+1)*O
where the INDIVIDUAL numbers are
IW: input-to-hidden I*H
B1: bias-to-hidden 1*H
LW: hidden-to-output H*O
B2: bias-to-output 1*O
4. For regression examples 4 and/or 6 and/or 7, i.e.,
[ x4, t4 ] = building_dataset % Building Energy dataset
[ x6, t6 ] = cho_dataset; % Cholesterol dataset
[ x7, t7 ] = engine_dataset; % Engine behavior dataset
use the following command to create the default configuration for the regression net
net = fitnet;
5. Apply the functions in part 2 to as many of the datasets in part 4 as you need in order to understand how they work with respect to one another
6. Post if you have any more questions
Hope this helps.
*Thank you for formally accepting my answer*
Greg
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!