【问题标题】:How to set newff (neural network toolbox function) in MATLAB?如何在 MATLAB 中设置 newff(神经网络工具箱函数)?
【发布时间】:2012-03-22 11:30:59
【问题描述】:

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

这是我的代码

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 

【问题讨论】:

    标签: matlab neural-network


    【解决方案1】:

    您不想使用 newff 的原因有很多,但是 RTFM:

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

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

    语法

     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' );
    

    【讨论】:

    • 如果我不应该使用 newff,你有什么建议?
    • feedforwardnet() 从 matlab 文档中推荐。您还可以使用 network() ,对于更专业的事情,例如级联网络,您应该使用查看文档。
    猜你喜欢
    • 2011-07-08
    • 1970-01-01
    • 2015-06-03
    • 2014-04-20
    • 2014-01-02
    • 2013-01-13
    • 2013-09-07
    • 2013-04-10
    • 2012-04-20
    相关资源
    最近更新 更多