1
鑑於此CSV(GoogleSheets)。我想保留數值不變。我怎樣才能真正利用這些數據來訓練我的前饋網絡?如何將Encv的csv輸出顏色正常化?
// Load and prepare training data
var dataSource = new CSVDataSource("trainingData.csv", true, CSVFormat.DecimalPoint);
var data = new VersatileMLDataSet(dataSource);
ColumnDefinition outputColumn = data.DefineSourceColumn("Action", ColumnType.Nominal);
data.DefineSingleOutputOthersInput(outputColumn);
data.Analyze();
// Build neural net
var neuralNet = BuildNeuralNet();
// Train neural net
var train = new Backpropagation(neuralNet, data);
int epoch = 1;
do
{
train.Iteration();
Console.WriteLine(@"Epoch #" + epoch + @" Error : " + train.Error);
epoch++;
} while (train.Error > errorThreshold);
這就是EncogError執行過程中出現了: 「機器學習方法具有5輸入長度,但訓練數據爲0。他們必須是相同的。」
private static BasicNetwork BuildNeuralNet()
{
var net = new BasicNetwork();
net.AddLayer(new BasicLayer(null, true, m_inputNodeCount)); // input layer
net.AddLayer(new BasicLayer(new ActivationSigmoid(), true, m_hiddenNodeCount)); // #1 hidden layer
net.AddLayer(new BasicLayer(new ActivationSigmoid(), false, m_outputNodeCount)); // output layer
net.Structure.FinalizeStructure();
net.Reset(); // initializes the weights of the neural net
return net;
}
BuildNeuralNet()的內容是什麼? – 2016-06-12 14:49:51
這只是初始化BasicNetwork,添加圖層,完成結構和重新設置權重。輸入節點數指定爲5。 – MarcoMeter