【问题标题】:Elman neural network Learn multiple-series seriesElman 神经网络 Learn 多系列系列
【发布时间】:2023-04-07 13:28:01
【问题描述】:

我从神经网络开始,我想知道如何将多个输入列表作为学习示例。在文档中提供的示例如下:

[X,T] = simpleseries_dataset;
net = elmannet(1:2,10);
[Xs,Xi,Ai,Ts] = preparets(net,X,T);
net = train(net,Xs,Ts,Xi,Ai);
view(net)
Y = net(Xs,Xi,Ai);
perf = perform(net,Ts,Y)

Xs 和 Ts 是输入和目标,如果我有薮系列,我应该重复每个系列的学习吗?谢谢

【问题讨论】:

    标签: matlab machine-learning neural-network classification


    【解决方案1】:

    您应该使用数组的元胞数组。例如,如果您有两个系列:x1_1,x1_2,x1_3,...x2_1,x2_2,x2_3,...,则单元格数组应为 {[x1_1,x2_1],[x1_2,x2_2],[x1_3,x2_3],...}。如果系列有不同的长度,那么较短的系列应该用 NaN 填充。可以使用catsamples函数来简化代码:

    [X,T] = simpleseries_dataset;
    x1= X(1:30); t1= T(1:30); % first subsequence
    x2= X(50:75); t2= T(50:75); % second subsequence
    Xm = catsamples(x1,x2,'pad'); % concatenate to the cell array
    Tm = catsamples(t1,t2,'pad'); % padding whith NaNs 
    net = elmannet(1:2,10);
    [Xs,Xi,Ai,Ts] = preparets(net,Xm,Tm);
    net = train(net,Xs,Ts,Xi,Ai);
    Y = net(Xs,Xi,Ai);
    perf = perform(net,Ts,Y)
    

    【讨论】:

    • 感谢您的回答,就我而言,我的两个系列的形式为:(x1_1,y1_1),(x1_2,y1_2),(x1_3,y1_3)....(x1_N,y1_N ) 和 (x2_1,y2_1),(x2_2,y2_2),(x2_3,y2_3)....(x2_N,y2_N)
    • 在这种情况下(系列大小相同),您不需要填充元胞数组:Xm = catsamples(x1,x2); Ym = catsamples(y1,y2);
    • 不,对不起,我认为我没有很好地解释我的问题,我想使用多个时间序列,它是多个轨迹的一种形式,应该使用 (x1,y1) 来预测 ( x'1,y'1) 和 (x2,y2) 应该用于预测 (x'2,y'2)
    猜你喜欢
    • 2011-01-02
    • 1970-01-01
    • 2013-01-08
    • 2021-01-25
    • 2016-09-01
    • 1970-01-01
    • 2010-12-14
    • 1970-01-01
    • 2013-05-20
    相关资源
    最近更新 更多