some nftool basics - data in, net config, and net save
Show older comments
Hi - have some newbie/basic nftool questions using R2011a:
1. the GUI Select Data - selected Inputs file - summary shows correct data matrix, then selected Targets - the summary shows correct data matrix but replaces the Inputs with the Targets layout. So actuals: 5 inputs in input file, 1 output in targets file gets shown in summary as: 1 input and 1 target. All the data used were random numbers between 0 and 100. My network is called 'net'.
2. used advanced script generator to run nftool from script - added commands to load correct inputs and targets. nftool runs fine. The view(net) shows correct net 5 inputs and 1 output. I used 7 hidden nodes but while view(net) shows this structure running the command 'net' says inputs = 1 and outputs = 1 and no info on number of hidden nodes. Why is net structure different from view(net)?
4. Ran: myoutputs = net([1 2 3 4 5]); says input is wrong size.
Any advice welcome Thanks JohnG
Answers (1)
Greg Heath
on 28 Jan 2013
0 votes
You have 1 5-dimensional input and 1 1-dimensional output. Therefore the sizes of your input and target matrices should be
[ 5 N ] = size(input)
[ 1 N ] = size(target)
For N =1, you have to transpose your 1x5 input.
Hope this helps.
Thank you for formally accepting my answer.
Greg
1 Comment
Thanks Greg - however, I did use the line: inputs = newData1.inputs'; targets = newData1.targets'; so my data was transposed. The nftool simulation worked fine and shows 5 inputs and 1 target. re my question 1: using the Import Wizard shows data import as 1053 x5: 1053 samples of 5 elements (using Matrix rows) - so that's good. When I then select the Targets the summary of the Inputs gets changed 1053 x 1. Weird??
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!