From c60dfa561d4d1abfcdc3070183e997eecf391b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Old=C5=99ich=20Ko=C5=BEelsk=C3=BD?= Date: Mon, 2 Sep 2019 18:06:02 +0200 Subject: [PATCH] Redesign (final phase) --- RCNet/Neural/Network/SM/StateMachine.cs | 114 ++++++++++++------------ 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/RCNet/Neural/Network/SM/StateMachine.cs b/RCNet/Neural/Network/SM/StateMachine.cs index 2cb7add..6a51427 100644 --- a/RCNet/Neural/Network/SM/StateMachine.cs +++ b/RCNet/Neural/Network/SM/StateMachine.cs @@ -357,68 +357,72 @@ public string CreateReport(int margin = 0) sb.Append(leftMargin + $"Neural preprocessor ({ReservoirStatCollection.Count} {resWording}, {TotalNumOfNeurons} neurons, {TotalNumOfInternalSynapses} internal synapses)" + Environment.NewLine); foreach (ReservoirStat resStat in ReservoirStatCollection) { - sb.Append(leftMargin + $" Reservoir instance: {resStat.ReservoirInstanceName} (configuration {resStat.ReservoirSettingsName}, {resStat.TotalNumOfNeurons} neurons, {Math.Round(resStat.ExcitatoryNeuronsRatio * 100, 1).ToString(CultureInfo.InvariantCulture)}% excitatory neurons, {resStat.TotalNumOfInternalSynapses} internal synapses)" + Environment.NewLine); - sb.Append(leftMargin + $" Zero incoming res. stimuli : {resStat.NumOfNoRStimuliNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Zero emitted analog signal : {resStat.NumOfNoAnalogOutputSignalNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Const emitted analog signal: {resStat.NumOfConstAnalogOutputSignalNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Not firing : {resStat.NumOfNotFiringNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Const firing: {resStat.NumOfConstFiringNeurons} neurons" + Environment.NewLine); + sb.Append(leftMargin + $" Reservoir instance: {resStat.ReservoirInstanceName} (configuration {resStat.ReservoirSettingsName}, {resStat.TotalNumOfNeurons} neurons, {Math.Round(resStat.ExcitatoryNeuronsRatio * 100, 1).ToString(CultureInfo.InvariantCulture)}% excitatory neurons, {resStat.TotalNumOfInternalSynapses} internal synapses)" + Environment.NewLine); + sb.Append(leftMargin + $" Activity" + Environment.NewLine); + sb.Append(leftMargin + $" {resStat.NumOfNoRStimuliNeurons} neurons receive no stimulation from the reservoir" + Environment.NewLine); + sb.Append(leftMargin + $" {resStat.NumOfNoAnalogOutputSignalNeurons} neurons produce no analog signal" + Environment.NewLine); + sb.Append(leftMargin + $" {resStat.NumOfConstAnalogOutputSignalNeurons} neurons produce constant analog signal" + Environment.NewLine); + sb.Append(leftMargin + $" {resStat.NumOfNotFiringNeurons} neurons don't spike" + Environment.NewLine); + sb.Append(leftMargin + $" {resStat.NumOfConstFiringNeurons} neurons are constantly firing" + Environment.NewLine); foreach (ReservoirStat.PoolStat poolStat in resStat.PoolStatCollection) { - sb.Append(leftMargin + $" Pool: {poolStat.PoolName} ({poolStat.NumOfNeurons} neurons, {Math.Round(poolStat.ExcitatoryNeuronsRatio * 100, 1).ToString(CultureInfo.InvariantCulture)}% excitatory neurons, {poolStat.InternalAnalogWeightsStat.NumOfSamples + poolStat.InternalSpikingWeightsStat.NumOfSamples} internal synapses)" + Environment.NewLine); - sb.Append(leftMargin + $" Zero incoming res. stimuli : {poolStat.NumOfNoRStimuliNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Zero emitted analog signal : {poolStat.NumOfNoAnalogOutputSignalNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Const emitted analog signal: {poolStat.NumOfConstAnalogOutputSignalNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Not firing : {poolStat.NumOfNotFiringNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Const firing: {poolStat.NumOfConstFiringNeurons} neurons" + Environment.NewLine); + sb.Append(leftMargin + $" Pool: {poolStat.PoolName} ({poolStat.NumOfNeurons} neurons, {Math.Round(poolStat.ExcitatoryNeuronsRatio * 100, 1).ToString(CultureInfo.InvariantCulture)}% excitatory neurons, {poolStat.InternalAnalogWeightsStat.NumOfSamples + poolStat.InternalSpikingWeightsStat.NumOfSamples} internal synapses)" + Environment.NewLine); + sb.Append(leftMargin + $" Activity" + Environment.NewLine); + sb.Append(leftMargin + $" {poolStat.NumOfNoRStimuliNeurons} neurons receive no stimulation from the reservoir" + Environment.NewLine); + sb.Append(leftMargin + $" {poolStat.NumOfNoAnalogOutputSignalNeurons} neurons produce no analog signal" + Environment.NewLine); + sb.Append(leftMargin + $" {poolStat.NumOfConstAnalogOutputSignalNeurons} neurons produce constant analog signal" + Environment.NewLine); + sb.Append(leftMargin + $" {poolStat.NumOfNotFiringNeurons} neurons don't spike" + Environment.NewLine); + sb.Append(leftMargin + $" {poolStat.NumOfConstFiringNeurons} neurons are constantly firing" + Environment.NewLine); + sb.Append(leftMargin + $" Weights of synapses" + Environment.NewLine); + sb.Append(leftMargin + $" Input > {StatLine(poolStat.InputWeightsStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Int. Analog > {StatLine(poolStat.InternalAnalogWeightsStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Int. Spiking> {StatLine(poolStat.InternalSpikingWeightsStat)}" + Environment.NewLine); foreach (ReservoirStat.PoolStat.NeuronGroupStat groupStat in poolStat.NeuronGroupStatCollection) { - sb.Append(leftMargin + $" Group of neurons: {groupStat.GroupName} ({groupStat.AvgAnalogSignalStat.NumOfSamples} neurons)" + Environment.NewLine); - sb.Append(leftMargin + $" Zero incoming res. stimuli : {groupStat.NumOfNoRStimuliNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Zero emitted analog signal : {groupStat.NumOfNoAnalogOutputSignalNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Const emitted analog signal: {groupStat.NumOfConstAnalogOutputSignalNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Not firing : {groupStat.NumOfNotFiringNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Const firing: {groupStat.NumOfConstFiringNeurons} neurons" + Environment.NewLine); - sb.Append(leftMargin + $" Stimulation from Input neurons " + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgIStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxIStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinIStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.IStimuliSpansStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Stimulation from Reservoir neurons" + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgRStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxRStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinRStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.RStimuliSpansStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Total stimulation (including Bias)" + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgTStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxTStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinTStimuliStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.TStimuliSpansStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Efficacy of synapses" + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgSynEfficacyStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxSynEfficacyStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinSynEfficacyStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.SynEfficacySpansStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Activation" + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgActivationStatesStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxActivationStatesStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinActivationStatesStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.ActivationStateSpansStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Analog signal" + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgAnalogSignalStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxAnalogSignalStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinAnalogSignalStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Spiking signal" + Environment.NewLine); - sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgFiringStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxFiringStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinFiringStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Group of neurons: {groupStat.GroupName} ({groupStat.AvgAnalogSignalStat.NumOfSamples} neurons)" + Environment.NewLine); + sb.Append(leftMargin + $" Activity" + Environment.NewLine); + sb.Append(leftMargin + $" {groupStat.NumOfNoRStimuliNeurons} neurons receive no stimulation from the reservoir" + Environment.NewLine); + sb.Append(leftMargin + $" {groupStat.NumOfNoAnalogOutputSignalNeurons} neurons produce no analog signal" + Environment.NewLine); + sb.Append(leftMargin + $" {groupStat.NumOfConstAnalogOutputSignalNeurons} neurons produce constant analog signal" + Environment.NewLine); + sb.Append(leftMargin + $" {groupStat.NumOfNotFiringNeurons} neurons don't spike" + Environment.NewLine); + sb.Append(leftMargin + $" {groupStat.NumOfConstFiringNeurons} neurons are constantly firing" + Environment.NewLine); + sb.Append(leftMargin + $" Stimulation from input neurons" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgIStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxIStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinIStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.IStimuliSpansStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Stimulation from reservoir neurons" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgRStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxRStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinRStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.RStimuliSpansStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Total stimulation (including Bias)" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgTStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxTStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinTStimuliStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.TStimuliSpansStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Efficacy of synapses" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgSynEfficacyStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxSynEfficacyStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinSynEfficacyStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.SynEfficacySpansStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Activation" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgActivationStatesStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxActivationStatesStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinActivationStatesStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" SPAN> {StatLine(groupStat.ActivationStateSpansStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Analog output" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgAnalogSignalStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxAnalogSignalStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinAnalogSignalStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" Spiking signal" + Environment.NewLine); + sb.Append(leftMargin + $" AVG> {StatLine(groupStat.AvgFiringStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MAX> {StatLine(groupStat.MaxFiringStat)}" + Environment.NewLine); + sb.Append(leftMargin + $" MIN> {StatLine(groupStat.MinFiringStat)}" + Environment.NewLine); } - sb.Append(leftMargin + $" Weights of synapses" + Environment.NewLine); - sb.Append(leftMargin + $" Input > {StatLine(poolStat.InputWeightsStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Int. Analog > {StatLine(poolStat.InternalAnalogWeightsStat)}" + Environment.NewLine); - sb.Append(leftMargin + $" Int. Spiking > {StatLine(poolStat.InternalSpikingWeightsStat)}" + Environment.NewLine); } } + sb.Append(Environment.NewLine); sb.Append(leftMargin + $"Number of unused (invalid) predictors: {NumOfUnusedPredictors}" + Environment.NewLine); return sb.ToString(); }