Exemple #1
0
 /// <summary>
 /// Instanciate a new layer of input neurons. You'll hardly need to call this as the preferred way to create layers is using the network classes.
 /// </summary>
 /// <param name="neuronCount">The count of neurons this input layer shall create.</param>
 /// <param name="binding">The input data to bind to this input layer.</param>
 /// <param name="config">The configuration instance.</param>
 public Layer(ConfigNode node, int neuronCount, double[] binding)
 {
     node.AttatchToHost(this);
     _behavior = LayerBehaviorFlags.Bound;
     _binding  = binding;
     AddRange(neuronCount);
 }
Exemple #2
0
 /// <summary>
 /// Instanciate a new layer of input neurons. You'll hardly need to call this as the preferred way to create layers is using the network classes.
 /// </summary>
 /// <param name="neurons">A list of neurons to put into this layer.</param>
 /// <param name="binding">The input data to bind to this input layer.</param>
 /// <param name="config">The configuration instance.</param>
 public Layer(ConfigNode node, IEnumerable <Neuron> neurons, double[] binding)
 {
     node.AttatchToHost(this);
     _behavior = LayerBehaviorFlags.Bound;
     _binding  = binding;
     AddRange(neurons);
 }
Exemple #3
0
 /// <summary>
 /// Instanciate a new layer of non-input neurons. You'll hardly need to call this as the preferred way to create layers is using the network classes.
 /// </summary>
 /// <param name="neurons">A list of neurons to put into this layer.</param>
 /// <param name="source">The layer that will feed/point to this layer.</param>
 /// <param name="config">The configuration instance.</param>
 public Layer(ConfigNode node, IEnumerable <Neuron> neurons, Layer source)
 {
     node.AttatchToHost(this);
     _behavior    = LayerBehaviorFlags.Feeded;
     _sourceLayer = source;
     AddRange(neurons);
     source.FeedLayer(this);
 }
Exemple #4
0
 /// <summary>
 /// Instanciate a new layer of non-input neurons. You'll hardly need to call this as the preferred way to create layers is using the network classes.
 /// </summary>
 /// <param name="neuronCount">The count of neurons this layer shall create.</param>
 /// <param name="source">The layer that will feed/point to this layer.</param>
 /// <param name="config">The configuration instance.</param>
 public Layer(ConfigNode node, int neuronCount, Layer source)
 {
     node.AttatchToHost(this);
     _behavior    = LayerBehaviorFlags.Feeded;
     _sourceLayer = source;
     AddRange(neuronCount);
     source.FeedLayer(this);
 }
Exemple #5
0
 private void FeedLayer(Layer layer)
 {
     _behavior   |= LayerBehaviorFlags.Feeding;
     _targetLayer = layer;
     if (LayerAppended != null)
     {
         LayerAppended(this, new LayerEventArgs(layer));
     }
 }
Exemple #6
0
 /// <summary>
 /// Remove the bindings of this layer's neurons.
 /// </summary>
 public void RemoveActivityBinding()
 {
     _behavior &= ~LayerBehaviorFlags.Bound;
     _binding   = null;
 }
Exemple #7
0
 /// <summary>
 /// Bind the activity of this layer's neurons to a double array.
 /// </summary>
 /// <param name="source">the array to bind to</param>
 public void BindActivity(double[] source)
 {
     _behavior |= LayerBehaviorFlags.Bound;
     _binding   = source;
 }
Exemple #8
0
 /// <summary>
 /// Instanciate a new layer of neurons. You'll hardly need to call this as the preferred way to create layers is using the network classes.
 /// </summary>
 /// <param name="neuronCount">The count of neurons this layer shall create.</param>
 /// <param name="config">The configuration instance.</param>
 public Layer(ConfigNode node, int neuronCount)
 {
     node.AttatchToHost(this);
     _behavior = LayerBehaviorFlags.None;
     AddRange(neuronCount);
 }
Exemple #9
0
 /// <summary>
 /// Instanciate a new layer of neurons. You'll hardly need to call this as the preferred way to create layers is using the network classes.
 /// </summary>
 /// <param name="neurons">A list of neurons to put into this layer.</param>
 /// <param name="config">The configuration instance.</param>
 public Layer(ConfigNode node, IEnumerable <Neuron> neurons)
 {
     node.AttatchToHost(this);
     _behavior = LayerBehaviorFlags.None;
     AddRange(neurons);
 }