}
@Override
protected void buildInternal()
{
TrainingDataset data = getLearningData();
builder.setActivationFuncitonFactory(new IFactory<IFunction>()
{
public IFunction create()
{
return new VarSigmoidFunction();
}
});
for (int i = 0; i < data.getInputsCount(); ++i)
{
builder.addDataInputSynapseGenerative(i, 1, i);
}
int currentLayerIndex = 0;
if (hidenLayersCount > 0)
{
for (int i = 0; i < data.getInputsCount(); ++i)
{
for (int j = 0; j < neuronsInEachHidenLayer; ++j)
{
builder.addSynapseGenerative(currentLayerIndex, i, nextRandomSynapseWeight(),
currentLayerIndex + 1, j);
}
}
}
for (int k = 0; k < hidenLayersCount - 1; ++k)
{
currentLayerIndex++;
for (int i = 0; i < neuronsInEachHidenLayer; ++i)
{
for (int j = 0; j < neuronsInEachHidenLayer; ++j)
{
builder.addSynapseGenerative(currentLayerIndex, i, nextRandomSynapseWeight(),
currentLayerIndex + 1, j);
}
}
}
if (hidenLayersCount > 0)
{
currentLayerIndex++;
}
int neuronsInCurrentLayer =
builder.getNetwork().getLayers().get(currentLayerIndex).getNeurons().size();
for (int i = 0; i < neuronsInCurrentLayer; ++i)
{
for (int j = 0; j < data.getOutputsCount(); ++j)
{
builder.addSynapseGenerative(currentLayerIndex, i, nextRandomSynapseWeight(),
currentLayerIndex + 1, j);
}
}