Error when running patternnet example code from Help documentation

2 ビュー (過去 30 日間)
Robert McKellar
Robert McKellar 2014 年 10 月 13 日
コメント済み: Sunin Kingdom 2018 年 8 月 1 日
I am attempting to run the example code from the Help documentation for function patternnet:
[x,t] = iris_dataset;
net = patternnet(10);
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,t,y);
classes = vec2ind(y);
I get an error in the command window when when I try to run patternnet(10):
Error using boiler_transfer (line 98)
Unrecognized code: 'defaultParam'
Error in softmax (line 75)
boiler_transfer
Error in network/subsasgn>getDefaultParam (line 2048)
param = struct(feval(fcn,'defaultParam'));
Error in network/subsasgn>setLayerTransferFcn (line 1224)
net.layers{i}.transferParam = getDefaultParam(transferFcn);
Error in network/subsasgn>network_subsasgn (line 208)
if isempty(err), [net,err] = setLayerTransferFcn(net,i,transferFcn); end
Error in network/subsasgn (line 13)
net = network_subsasgn(net,subscripts,v,netname);
Error in patternnet>create_network (line 104)
net.layers{net.numLayers}.transferFcn = 'softmax';
Error in patternnet (line 71)
net = create_network(param);
Can anyone shed some light on what is going wrong? I am running Matlab 2014a.
Regards
Bob

採用された回答

Siddharth Sundar
Siddharth Sundar 2014 年 10 月 14 日
編集済み: Siddharth Sundar 2014 年 10 月 14 日
From the error, it looks like you could have another function softmax that shadows the one shipped with the product. So you might want to try the which command:
which -all softmax
If this lists more than the softmax at the location 'toolbox\nnet\nnet\nntransfer\softmax.m', you might want to remove the other softmax.m from your path before using the patternnet function.
  3 件のコメント
Jason Potas
Jason Potas 2016 年 11 月 22 日
Awesome thanks, that was also my issue; a deep learning toolbox also had a softmax function in a different path, so by removing it from the set paths it now works fine.
Sunin Kingdom
Sunin Kingdom 2018 年 8 月 1 日
It works.Thank you very much 6_0

サインインしてコメントする。

その他の回答 (1 件)

Greg Heath
Greg Heath 2014 年 10 月 14 日
The only thing that I can think of is to use clear or clear all before using those 7 commands.

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by