Encog downloads a CSV file using a custom network

I want to load data from a CSV file as follows:

var format = new CSVFormat('.', ' '); 
IVersatileDataSource source = new CSVDataSource(filename, false, format);
var data = new VersatileMLDataSet(source); ...

Then I have two options:

Use EncogModel

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

Make your own network

var network = new BasicNetwork();
network.AddLayer(new BasicLayer(null, true, 11));
network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 8));
network.AddLayer(new BasicLayer(new ActivationTANH(), true, 5)); 
...
IMLDataSet trainingSet = new BasicMLDataSet(input, output);

I do not know how to set the number of layers, neurons and activation functions with the first option (Encog Model). All I get is some standard network with direct connection with only one hidden layer.


I do not know how easy it is to get input and output arrays separately for my own network (second option) from VersatileMLDataSet. I can get the whole array (input + output), but there should be a way to get only the input array or output array.

+4
source share
1 answer

(Encog Method and Training Factories, . 75), EncogModel ​​ :

var methodFactory = new MLMethodFactory();
var method = methodFactory . Create(
MLMethodFactory .TYPEFEEDFORWARD,
"?:B−>SIGMOID−>4:B−>SIGMOID−>?",
2,
1);

. . . , . , , . . , . . , create, .

+3

Source: https://habr.com/ru/post/1654755/


All Articles