public static INetwork BuildFFN(NetworkSettings settings, HiddenLayerSettings hiddenSettings) { Network ffn = new Network(settings); ffn.BuildInputNeurons(settings); ffn.HiddenLayers = ffn.BuildHiddenLayers(ffn.InputNeurons, hiddenSettings); ffn.BuildOutputNeurons(ffn.HiddenLayers.Last(), settings.OutputNeuronsCount, settings.OutputLayerFunction); return(ffn); }
public static INetwork BuildRNN(NetworkSettings settings, HiddenLayerSettings hiddenSettings) { Network rnn = new Network(settings); rnn.BuildInputNeurons(settings); rnn.HiddenLayers = rnn.BuildHiddenLayers(rnn.InputNeurons, hiddenSettings); var prevLayer = rnn.BuildOutputNeurons(rnn.HiddenLayers.Last(), settings.OutputNeuronsCount, settings.OutputLayerFunction); var outputLayer = rnn.BuildInputNeurons(settings, 1); var prevLayerEnumerator = prevLayer.GetEnumerator(); var outputLayerEnumerator = outputLayer.GetEnumerator(); while (prevLayerEnumerator.MoveNext()) { outputLayerEnumerator.MoveNext(); rnn.ConnectAxon(prevLayerEnumerator.Current, outputLayerEnumerator.Current, settings.OutputNeuronsCount); } return(rnn); }