0
我正在嘗試使用交叉熵來實現RNN。下面是我的代碼:Matlab:在神經網絡中使用交叉熵
net = layrecnet(1:2,10);
net.performFcn = 'crossentropy';
net.performParam.regularization = 0.1;
net.performParam.normalization = 'none';
[Xs,Xi,Ai,Ts] = preparets(net, featureMatrix, labels);
net = train(net,Xs,Ts,Xi,Ai);
% view(net)
Y = net(Xs,Xi,Ai);
perf = perform(net,Y,Ts);
的performParam
是從MATLAB的官方doc。但是,我執行後,我得到了一個警告說:
Warning: Performance function replaced with squared
error performance.
> In trainlm>formatNet (line 155)
In trainlm (line 65)
In nntraining.setup (line 14)
In network/train (line 335)
即使我執行前饋網,我也得到了同樣的警告。以下是我的代碼。
[x,t] = simplefit_dataset;
net = feedforwardnet(10);
net.performFcn = 'crossentropy';
net.performParam.regularization = 0.1;
net.performParam.normalization = 'none';
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,y,t);
那麼我怎麼能在我的代碼中使用交叉熵呢?
[請點擊此鏈接](http://ch.mathworks.com/matlabcentral/answers/261735-i-get-a-performance-function-replaced-with-squared-error-性能警告,當試圖設置c) – obchardon
@obchardon我讀過,但沒有幫助。 – spacegoing