Encog:“机器学习方法的输入长度为7,而训练的输入长度为0".错误 [英] Encog :"The Machine Learning Method has an input length of 7, but the training has 0" error

查看:92
本文介绍了Encog:“机器学习方法的输入长度为7,而训练的输入长度为0".错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个项目,其中使用ENcog(.net)对emg信号进行分类,功能已被提取,当我尝试对其进行训练时,如标题所述,它会出错. 这是我使用的代码:

I'm currently having a project in which I use ENcog(.net) to classify emg signal, the features is already extracted, when I try to train it, it gets error as the title says. Here is the code I use :

        BasicNetwork JST = new BasicNetwork();
        JST.AddLayer(new BasicLayer(7));
        JST.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 10));
        JST.AddLayer(new BasicLayer(new ActivationLinear(), true, 4));
        JST.Structure.FinalizeStructure();
        JST.Reset();

        openFileDialog1.Title = "Open Feature File...";
        openFileDialog1.FileName = "";
        openFileDialog1.Filter = "CSV (comma delimited)|*.csv|All Files|*.*";
        if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
        {
            MessageBox.Show("Choice Cancelled");
        }
        else
        {
            IVersatileDataSource data = new CSVDataSource(openFileDialog1.FileName, false, CSVFormat.DecimalComma);
            var InputJST = new VersatileMLDataSet(data);
            InputJST.DefineSourceColumn("MAV", 0, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            InputJST.DefineSourceColumn("RMS", 1, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            InputJST.DefineSourceColumn("VAR", 2, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            InputJST.DefineSourceColumn("SD", 3, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            InputJST.DefineSourceColumn("WL", 4, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            InputJST.DefineSourceColumn("ZC", 5, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            InputJST.DefineSourceColumn("SSC", 6, Encog.ML.Data.Versatile.Columns.ColumnType.Continuous);
            ColumnDefinition outputColumn = InputJST.DefineSourceColumn("Arrow", 7, ColumnType.Nominal);
            InputJST.DefineSingleOutputOthersInput(outputColumn);
            InputJST.Analyze();

            var model = new EncogModel(InputJST);
            model.SelectMethod(InputJST, MLMethodFactory.TypeFeedforward);
            InputJST.Normalize();

            var train = new LevenbergMarquardtTraining(JST, InputJST);

我的问题是,即使计算出的大小正确,为什么数据集也具有Inputsize和Idealsize 0?

My question is why the dataset have Inputsize and idealsize 0, eventhough the calculated size is correct?

谢谢.

推荐答案

在讨论了代码之后,我确实获得了解决方案,只需将规范化的数据集保存到csv中,然后使用csvmldataset重新加载.

After buzzing around with the codes, I do get the solutions, simply save the normalized dataset into csv, then reload it back with csvmldataset.

如果每个人都想知道为什么不使用csv规范化器,因为结果是不期望的(等边的).

If everybody wonders why not using the csv normalizer, because the result is undesired (equilateral).

PS:仍然有其他解决方案的人很感激,谢谢.

PS : Anybody who have other solution is still apreciated, thanks.

这篇关于Encog:“机器学习方法的输入长度为7,而训练的输入长度为0".错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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