public void InitBrain(BrainConfiguration configuration) { Brain = new Brain(); Brain.InitBrain(configuration); BrainControl.Brain = Brain; //BrainCharts.Brain = Brain; }
//[JsonRequired] //public BrainConfiguration Configuration { get; set; } public void InitLayers(BrainConfiguration configuration) { //Configuration = configuration; foreach (IBrainLayer layer in this) { layer.InitLayer(configuration); layer.InitFiredNeurons(); } globals.CachedNeuronCount = HiddenLayers.Sum(l => l.Count); }
public override void AfterDeserialization(BrainConfiguration configuration) { base.AfterDeserialization(configuration); for (int i = 0; i < configuration.NumInputClasses; i++) { List <Neuron> NeuronClass = new List <Neuron> (); Classes.Add(NeuronClass); for (int k = 0; k < configuration.NumInputClassNeurons; k++) { Neuron n = m_Neurons[(i * configuration.NumInputClassNeurons) + k]; NeuronClass.Add(n); } } }
public override void InitLayer(BrainConfiguration configuration) { for (int i = 0; i < configuration.NumInputClasses; i++) { List <Neuron> NeuronClass = new List <Neuron> (); Classes.Add(NeuronClass); for (int k = 0; k < configuration.NumInputClassNeurons; k++) { Neuron n = new Neuron(LayerIndex, i, configuration.NumInputClasses, NeuronTypes.Perceptron, ConnectionTypes.None); m_Neurons.Add(n); NeuronClass.Add(n); } } }
public override void InitLayer(BrainConfiguration configuration) { for (int i = 0; i < configuration.NumOutputClasses; i++) { List <Neuron> NeuronClass = new List <Neuron> (); Classes.Add(NeuronClass); for (int k = 0; k < configuration.NumOutputClassNeurons; k++) { int length = (int)(ThreadSafeRandom.NextDouble() * configuration.NumInputClasses) + 1; Neuron n = new Neuron(LayerIndex, i, length, NeuronTypes.MirrorNeuron, ConnectionTypes.PreviousLayer, configuration.OutputLayerMaxSynapses); m_Neurons.Add(n); NeuronClass.Add(n); } } }
public void InitBrain(BrainConfiguration configuration) { Configuration = configuration; int layerIndex = 0; Layers.Add(new InputLayer(layerIndex++)); for (int i = 0; i < configuration.NumHiddenLayers; i++) { Layers.Add(new HiddenLayer(layerIndex++)); } Layers.Add(new OutputLayer(layerIndex++)); Layers.InitLayers(configuration); CalcConnectionCount(); CalcTotalEmphasis(); }
public override void InitLayer(BrainConfiguration configuration) { int neuronsPerColumn = configuration.NeuronsPerHiddenLayer / configuration.NumInputClasses; for (int i = 0; i < configuration.NumInputClasses; i++) { for (int k = 0; k < neuronsPerColumn; k++) { int length = (int)(ThreadSafeRandom.NextDouble() * configuration.NumInputClasses) + 1; m_Neurons.Add(new Neuron(LayerIndex, i, length, NeuronTypes.PyramidCell, ConnectionTypes.LocalLayer, configuration.HiddenLayerMaxSynapses)); m_Neurons.Add(new Neuron(LayerIndex, i, length / 2 + 1, NeuronTypes.Interneuron, ConnectionTypes.LocalLayer, configuration.HiddenLayerMaxSynapses)); } } /*** * for (int i = 0; i < configuration.NeuronsPerHiddenLayer; i++) { * m_Neurons.Add (new Neuron (LayerIndex, NeuronTypes.PyramidCell, ConnectionTypes.LocalLayer, configuration.HiddenLayerMaxSynapses)); * m_Neurons.Add (new Neuron (LayerIndex, NeuronTypes.Interneuron, ConnectionTypes.LocalLayer, configuration.HiddenLayerMaxSynapses)); * } ***/ }
public override void AfterDeserialization(BrainConfiguration configuration) { base.AfterDeserialization(configuration); }