“索引超过矩阵尺寸";神经网络功能错误 [英] "Index Exceeds Matrix Dimensions" neural network function error

查看:275
本文介绍了“索引超过矩阵尺寸";神经网络功能错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个数据集,它们是从 CSV 文件加载的,将它们分为X和T:

I've got two datasets, which I load from a CSV file, and split them into X and T:

X (3x5000) double
T (1x5000) double

我正在尝试配置此功能,但不能

I'm trying to configure this function, but I can't

http://www.mathworks.co.uk/help/toolbox/nnet/ref/layrecnet.html

X具有三个功能和5000个示例. T具有一项功能和5000个示例.例如,目标是功能1领先20步.所以基本上是X(1,21) == T(1).

X has three features and 5000 examples. T has one feature and 5000 examples. For an example the target is feature 1 20 steps ahead. So basically X(1,21) == T(1).

[X,T] = simpleseries_dataset;

这很好用,在这种情况下,我有1x100、1x100.

This works perfectly, in this case, I have 1x100, 1x100.

但是,如果我使用自己的数据集,则会得到以下信息:

If I use my own data set, however, I get this:

X = data(:,1:3)';
T = data(:,4)';
net = layrecnet(1:2,10);
[Xs,Xi,Ai,Ts] = preparets(net,X,T);

??? Index exceeds matrix dimensions.

Error in ==> preparets at 273
  ti = tt(:,FBS+((1-net.numLayerDelays):0));

我不明白,我在做什么错了?

I don't understand, what am I doing wrong?

更新

我注意到我的数据集是T(1x5000) double ,而示例数据集是T(1x100) cell . double和cell有什么区别?

I've noticed that my data set is T (1x5000) double while the example dataset is T (1x100) cell. What's the difference between double and cell?

推荐答案

我通过以下方式解决了该问题:

I solved it by:

X = num2cell(X);
T = num2cell(T);

我不知道为什么;它必须是MATLAB语法...

I have no idea why; it must be MATLAB syntax...

这篇关于“索引超过矩阵尺寸";神经网络功能错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆