gpt4 book ai didi

matlab - 如何在MATLAB中设置newff(神经网络工具箱函数)?

转载 作者:行者123 更新时间:2023-12-04 09:46:01 24 4
gpt4 key购买 nike

运行我的简单代码后出现错误。谢谢

这是我的代码

input_training_data = HandWritingData(random_list,:)'; %size = [256X788]
target_training_data = Category(random_list,:)'; %size = [10x788]
net = newff(minmax(input_training_data), [15 10], {'logsig','logsig'} , 'hardlim' );



Error in ==> Neural_Network_code at 19
net = newff(minmax(input_training_data), [15 10],
{'logsig','logsig'} , 'hardlim' ); %create a network

最佳答案

您不想使用 newff 而使用 RTFM 的原因有很多:

newff 创建一个前馈反向传播网络。

在 R2010b NNET 7.0 中已废弃。最后在 R2010a NNET 6.0.4 中使用。 推荐的函数是feedforwardnet。

语法

 net = newff(P,T,S)
net = newff(P,T,S,TF,BTF,BLF,PF,IPF,OPF,DDF)

描述

 newff(P,T,S) takes,
P - RxQ1 matrix of Q1 representative R-element input vectors.
T - SNxQ2 matrix of Q2 representative SN-element target vectors.
Si - Sizes of N-1 hidden layers, S1 to S(N-1), default = [].
(Output layer size SN is determined from T.)
and returns an N layer feed-forward backprop network.

newff(P,T,S,TF,BTF,BLF,PF,IPF,OPF,DDF) takes optional inputs,
TFi - Transfer function of ith layer. Default is 'tansig' for
hidden layers, and 'purelin' for output layer.
BTF - Backprop network training function, default = 'trainlm'.
BLF - Backprop weight/bias learning function, default = 'learngdm'.
PF - Performance function, default = 'mse'.
IPF - Row cell array of input processing functions.
Default is {'fixunknowns','remconstantrows','mapminmax'}.
OPF - Row cell array of output processing functions.
Default is {'remconstantrows','mapminmax'}.
DDF - Data division function, default = 'dividerand';
and returns an N layer feed-forward backprop network.

hardlim 不是传递函数。使用trainbg的trainlm。

net = newff(minmax(input_training_data), [15 10], {'logsig','logsig'} , 'trainlm' );

关于matlab - 如何在MATLAB中设置newff(神经网络工具箱函数)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9559108/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com