Encog :“The Machine Learning Method has an input length of 7, but the training has 0” error

旧城冷巷雨未停 提交于 2020-01-03 02:40:13

问题


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);

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

Thanks.


回答1:


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

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

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



来源:https://stackoverflow.com/questions/30827365/encog-the-machine-learning-method-has-an-input-length-of-7-but-the-training-h

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!