예제 #1
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;
 }
예제 #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);
     }
     _signal = stimuli;
     TransmissionFreqStat.AddSampleValue((_signal == 0) ? 0 : 1);
     return;
 }
예제 #3
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;
 }
예제 #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 + 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;
 }