public ActivationNetwork ToActivationNetwork(IActivationFunction function, int outputs)
{
ActivationNetwork ann = new ActivationNetwork(function,
inputsCount, hidden.Neurons.Length, outputs);
// For each neuron
for (int i = 0; i < hidden.Neurons.Length; i++)
{
ActivationNeuron aneuron = ann.Layers[0].Neurons[i] as ActivationNeuron;
StochasticNeuron sneuron = hidden.Neurons[i];
// For each weight
for (int j = 0; j < sneuron.Weights.Length; j++)
aneuron.Weights[j] = sneuron.Weights[j];
aneuron.Threshold = sneuron.Threshold;
aneuron.ActivationFunction = sneuron.ActivationFunction;
}
return ann;
}