【问题标题】:MLP with backpropagation in matlab在matlab中具有反向传播的MLP
【发布时间】:2017-03-20 21:55:47
【问题描述】:

我想构建一个包含 7 个神经元的隐藏层的 MLP 网络。我尝试在 Matlab 中使用 newff() 和 train(),但出现此错误: “没有为类 'network' 的值定义函数 'subsindex'。”

这是我的代码:

mytrain = mytrain';
train_class = train_class';
net = newff(minmax(mytrain),[7 1],{'logsig' 'logsig'}, 'traingd');
net.trainParam.epochs = 100;
net = train(net,mytrain,train_class); % the error comes from here
A = sim(net,mytrain);

任何想法都会有所帮助。 谢谢。

【问题讨论】:

    标签: matlab


    【解决方案1】:

    似乎所有问题都来自:

    mytrain = mytrain';
    train_class = train_class';
    

    我把这两个去掉了,写成这样的代码:

    net = newff(minmax(mytrain),[7 1],{'logsig' 'logsig'}, 'traingd');
    net.trainParam.epochs = 100;
    net = train(net,mytrain',train_class'); % I put the transpose command here
    

    成功了!!!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-11
      • 1970-01-01
      • 1970-01-01
      • 2019-09-11
      • 2014-03-07
      • 1970-01-01
      相关资源
      最近更新 更多