Fail to insert a dataset into an array.The array keeps showing that the dataset is an undefined function or variable
1 回表示 (過去 30 日間)
古いコメントを表示
Hey,
I am trying to insert a default build-in dataset into a feed-forward neural network. I followed the instructions and typed
load simplefit_dataset ;
[NNInputs, NNTargets] = simplefit_dataset ;
into the Command. It used to train and display the neural network window, but now just by inserting the dataset into the array, it keeps showing the error:
??? Undefined function or variable 'simplefit_dataset'.
And if I change "simplefit_dataset" to "[0, 0]" i.e.
[NNInputs NNTargets] = simplefit_dataset ;
or the other way
[NNInputs NNTargets] = [0 0] ;
I get the error:
??? Too many output arguments.
What a trivial yet unprecedented problem which keeps annoying me for hours. Thanks in advance !
0 件のコメント
採用された回答
Image Analyst
2014 年 1 月 4 日
編集済み: Image Analyst
2014 年 1 月 4 日
We don't know what got loaded. Try this:
s=load('simplefit_dataset.mat') % or whatever the actual filename of the .mat file is.
fields(s) % No semicolon to display fields into command window.
Tell us what you see.
Maybe you want
[NNInputs, NNTargets] = size(simplefit_dataset);
or
NNInputs = simplefit_dataset.NNInputs;
NNTargets = simplefit_dataset.NNTargets;
I'm not really sure until I see what you loaded and how you plan on using simplefit_dataset, NNInputs and NNTargets.
2 件のコメント
Image Analyst
2014 年 1 月 5 日
編集済み: Image Analyst
2014 年 1 月 5 日
This does not look right:
[NNInputs, NNTargets] = simplefit_dataset ;
For that to work, it would have to think that simplefit_dataset is a function (m-file, class, etc.) Since it's not, it should throw an error. It will not somehow magically dissect simplefit_dataset and stick part of it into NNInputs and stick some other part of it into NNTargets. It is not " inserting the Inputs and outputs into the matrix [NNInputs, NNOutputs]" as you said. I just can't imagine how it runs without error.
By the way, is there any reason why you didn't run the commands I first asked you to run?
その他の回答 (1 件)
Greg Heath
2014 年 1 月 6 日
1. In all of the nndatasets in the NNTBX, the inputs and outputs have the same number of columns.
help nndatasets
doc nndatasets
2. Therefore, it makes sense to try to use the semicolon format. However, that causes an error message that says you have to use a counterintuitive comma:
>> [ x ; t] = simplefit_dataset;
[ x ; t] = simplefit_dataset;
|
Error: Multiple left-hand sides must be separated by commas.
3. Using the counterintuitive comma works:
>> [ x , t] = simplefit_dataset; whos
Name Size Bytes Class Attributes
t 1x94 752 double
x 1x94 752 double
4. Note, however, a single output format yields
>> z = simplefit_dataset; whos, isequal(z,x)
Name Size Bytes Class Attributes
ans 1x1 1 logical
t 1x94 752 double
x 1x94 752 double
z 1x94 752 double
ans = 1
Hope this helps.
Thank you for formally accepting my answer (I'm trying to catch Image Analyst(;>) )
Greg
2 件のコメント
Image Analyst
2014 年 1 月 6 日
編集済み: Image Analyst
2014 年 1 月 6 日
I've never seen this work
[ x , t] = simplefit_dataset;
for a variable . I have for functions but not a variable. Is that some syntax that works for a special type of variable? I never use datasets, so does that syntax that works for dataset variables?
You're way ahead of everyone here in the acceptance ratio. You get an impressive 60-70% accepted (probably boosted by the fact that you're the only neural nets expert here) while the rest of use get only 20-30, so at least you have bragging rights about that.
Greg Heath
2014 年 1 月 7 日
The counterintuitive comma syntax is a special syntax used for downloading the 35 data sets used in NN examples and demos:
help nndatasets
doc nndatasets
help 'any NN function'
I don't know if it is valid elsewhere.
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!