【问题标题】:Creating a feedforwardnet model in Matlab在 Matlab 中创建前馈网络模型
【发布时间】:2013-06-05 08:57:17
【问题描述】:

我想实现一个这样工作的模型: 它有 3 个输入,例如 - 1,2,3 它给出 1 个输出 - 一个介于 0 到 1 之间的数字(包括 0 和 1)。 该模型是一个前馈网络——首先,它“训练”——它获取输入和结果,然后,根据他的训练,它可以给出一个只给出输入的结果,例如: 有一次他得到 1,2,3 结果:0, 他第二次得到 2,3,4 结果:0, 他第三次得到 3,4,5,结果:1。 他第四次得到 4,5,6 但没有结果 - 所以根据他的知识和算法,他会给出一个结果,比如说:0.45。

我的问题是输入的向量的大小和结果的向量的大小必须相等,所以当我只需要1的时候结果的向量必须包含3个元素-所以我做了所有的元素相同,意思是:它得到 [1 1 1] 或 [0 0 0] (我希望它不会破坏网络)。 无论如何,这是我模型的代码——我实现得好吗?因为我不确定……

% x1 is the input in the 1st case, x2 is the input in the 2nd case...
% t1 is the result in the 1st case, t2 is the result in the 2nd case...
net=feedforwardnet(1);
x1=[1 2 3];
t1=[0 0 0];
x2=[2 3 4];
t2=[0 0 0];
x3=[3 4 5];
t3=[1 1 1];
x4=[4 5 6];
net=train(net,x1,t1);
net=train(net,x2,t2);
net=train(net,x3,t3);
t4=net(x4)

【问题讨论】:

    标签: matlab feed-forward


    【解决方案1】:

    不,它应该训练一次,多个案例应该只放入一个矩阵

    the right program should be as follows:
    x = [x1', x2', x3'];
    t = [0 0 1];
    net = train(net, x, t);
    t4 = net(x4)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-13
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 2021-02-05
      • 2016-08-04
      • 2019-04-12
      • 2018-12-11
      相关资源
      最近更新 更多