Exemplo n.º 1
0
 //Methods
 /// <summary>
 /// Resets the neuron to its initial state
 /// </summary>
 /// <param name="resetStatistics">Specifies whether to reset internal statistics</param>
 public void Reset(bool resetStatistics)
 {
     _signal = 0;
     if (resetStatistics)
     {
         StimuliStat.Reset();
     }
     return;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Computes the neuron
 /// </summary>
 /// <param name="stimuli">Input stimulation</param>
 /// <param name="collectStatistics">Specifies whether to update internal statistics</param>
 public void Compute(double stimuli, bool collectStatistics)
 {
     stimuli = stimuli.Bound();
     if (collectStatistics)
     {
         StimuliStat.AddSampleValue(stimuli);
     }
     _signalConverter.EncodeAnalogValue(stimuli);
     return;
 }
Exemplo n.º 3
0
 //Constructor
 /// <summary>
 /// Creates an unitialized instance.
 /// </summary>
 /// <param name="groupName">The name of the group.</param>
 public NeuronGroupStat(string groupName)
 {
     GroupName        = groupName;
     NumOfNeurons     = 0;
     Activation       = new StandardStatSet();
     Stimuli          = new StimuliStat();
     Synapses         = new SynapsesByRoleStat();
     Signal           = new SignalStat();
     NeuronsAnomalies = new NeuronsAnomaliesStat();
     return;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Computes the neuron.
 /// </summary>
 /// <param name="stimuli">Input stimulation</param>
 /// <param name="collectStatistics">Specifies whether to update internal statistics</param>
 public void Compute(double stimuli, bool collectStatistics)
 {
     stimuli = stimuli.Bound();
     if (collectStatistics)
     {
         StimuliStat.AddSampleValue(stimuli);
     }
     _signal = stimuli;
     TransmissionFreqStat.AddSampleValue((_signal == 0) ? 0 : 1);
     return;
 }
Exemplo n.º 5
0
 //Methods
 /// <summary>
 /// Resets the neuron to its initial state
 /// </summary>
 /// <param name="statistics">Specifies whether to reset also internal statistics</param>
 public void Reset(bool statistics)
 {
     _activation.Reset();
     _state              = 0;
     _rescaledState      = 0;
     _transmissionSignal = 0;
     if (statistics)
     {
         StimuliStat.Reset();
         StatesStat.Reset();
         TransmissionSignalStat.Reset();
         TransmissionFreqStat.Reset();
     }
     return;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Computes the neuron.
 /// </summary>
 /// <param name="stimuli">Input stimulation</param>
 /// <param name="collectStatistics">Specifies whether to update internal statistics</param>
 public void Compute(double stimuli, bool collectStatistics)
 {
     stimuli = (stimuli + Bias).Bound();
     if (collectStatistics)
     {
         StimuliStat.AddSampleValue(stimuli);
     }
     //State and signal
     _signal = (_retainmentRatio * _state) + (1d - _retainmentRatio) * _activation.Compute(stimuli);
     _state  = _signal;
     //Compute rescaled state
     _rescaledState = _rescalledStateRange.Rescale(_state, _activation.InternalStateRange);
     //Statistics
     if (collectStatistics)
     {
         StatesStat.AddSampleValue(_rescaledState);
     }
     return;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Computes the neuron.
 /// </summary>
 /// <param name="stimuli">Input stimulation</param>
 /// <param name="collectStatistics">Specifies whether to update internal statistics</param>
 public void Compute(double stimuli, bool collectStatistics)
 {
     stimuli = (stimuli + Bias).Bound();
     if (collectStatistics)
     {
         StimuliStat.AddSampleValue(stimuli);
     }
     //State and spike
     _spike = _activation.Compute(stimuli);
     _state = _activation.InternalState;
     _firingRate.Update(_spike > 0);
     //Compute rescaled state
     _rescaledState = _rescalledStateRange.Rescale(_state, _activation.InternalStateRange);
     //Statistics
     if (collectStatistics)
     {
         StatesStat.AddSampleValue(_rescaledState);
     }
     return;
 }