public void AddAlgorithmParamsToTitle(AlgorithmParams algParams)
 {
     string paramsString = String.Format(
         CultureInfo.InvariantCulture,
         " [e: {0:F3}, m: {1:F3}, mfcc: {2}, sigfr: {3}, tc: {4:F3}]",
         algParams.LearningRate,
         algParams.Momentum,
         algParams.MfccCount,
         algParams.SignalFramesCount,
         algParams.TCoef);
     _plotTitle += paramsString;
 }
 public void CopyFrom(AlgorithmParams algorithmParams)
 {
     LearningRate = algorithmParams.LearningRate;
     Momentum = algorithmParams.Momentum;
     MfccCount = algorithmParams.MfccCount;
     TCoef = algorithmParams.TCoef;
     SignalFramesCount = algorithmParams.SignalFramesCount;
 }
        /// <summary>
        /// Resetule logikę (usuwa zbudowane sieci neuronowe itp.). Potem jest potrzebna nowa inicjalizacja.
        /// </summary>
        public void Reset()
        {
            if (WasAudioRecordingStarted) {
                audioRecorder.StopRecording();
                WasAudioRecordingStarted = false;
            }

            WasTrained = false;

            neuralNetworks = null;
            people = null;
            algorithmParams = null;
        }
        /// <summary>
        /// Inicjalizuje logikę (w praktyce: buduje sieci neuronowe).
        /// </summary>
        /// <param name="peopleToBeRecognized">Osoby, których rozpoznawania będziemy uczyć sieć.</param>
        /// <param name="algParams">Parametry algorytmu.</param>
        public void Init(IList<Person> peopleToBeRecognized, AlgorithmParams algParams)
        {
            if (peopleToBeRecognized == null) {
                throw new ArgumentNullException("peopleToBeRecognized");
            }

            if (!peopleToBeRecognized.Any()) {
                throw new ArgumentOutOfRangeException("peopleToBeRecognized", "You should assign at least one person.");
            }

            if (algParams == null) {
                throw new ArgumentNullException("algParams");
            }

            if (WasInitialized) {
                throw new InvalidOperationException("AlgorithmsLogic was already initialized!");
            }

            people = peopleToBeRecognized;
            algorithmParams = algParams;
            CreateNeuralNetworks();
        }