public void Store() { if (!Setup) { //Setup Mean and Std Statistics = new RunningStatistics[Values.Length]; for (int i = 0; i < Statistics.Length; i++) { Statistics[i] = new RunningStatistics(); } //Write Labels for (int i = 0; i < Names.Length; i++) { Labels.WriteLine("[" + i + "]" + " " + Names[i]); } Labels.Close(); Setup = true; } //Enqueue Sample float[] item = (float[])Values.Clone(); lock (Buffer) { Buffer.Enqueue(item); } //Reset Running Index Dim = 0; }
public void Finish() { if (Labels != null) { for (int i = 0; i < Names.Length; i++) { Labels.WriteLine("[" + i + "]" + " " + Names[i]); } Labels.Close(); } if (File != null) { File.Close(); } if (Norm != null) { string mean = string.Empty; for (int i = 0; i < Mean.Length; i++) { mean += Mean[i].Mean().ToString(Accuracy) + Separator; } mean = mean.Remove(mean.Length - 1); mean = mean.Replace(",", "."); Norm.WriteLine(mean); string std = string.Empty; for (int i = 0; i < Std.Length; i++) { std += (Std[i].Std() / Weights[i]).ToString(Accuracy) + Separator; } std = std.Remove(std.Length - 1); std = std.Replace(",", "."); Norm.WriteLine(std); Norm.Close(); } }