Example #1
0
 void neuralNetwork_IterationChanged(object o, NeuralEventArgs args)
 {
     if (ManualReset.WaitOne(0, true))
     {
         args.Stop = true;
     }
 }
        public void neuralNetwork_IterationChangedTest()
        {
            NeuralNetworksViewModel_Accessor target = new NeuralNetworksViewModel_Accessor(); // TODO: Initialize to an appropriate value
            object          sender = null;                                                    // TODO: Initialize to an appropriate value
            NeuralEventArgs args   = null;                                                    // TODO: Initialize to an appropriate value

            target.neuralNetwork_IterationChanged(sender, args);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Example #3
0
        public void NeuralEventArgsConstructorTest()
        {
            bool            stop      = false; // TODO: Initialize to an appropriate value
            double          currError = 0F;    // TODO: Initialize to an appropriate value
            int             currIter  = 0;     // TODO: Initialize to an appropriate value
            NeuralEventArgs target    = new NeuralEventArgs(stop, currError, currIter);

            Assert.Inconclusive("TODO: Implement code to verify target");
        }
        void neuralNetwork_IterationChanged(object o, NeuralEventArgs args)
        {
            UpdateError(args.CurrentError);
            UpdateIteration(args.CurrentIteration);

            if (ResetManual.WaitOne(0, true))
            {
                args.Stop = true;
            }
        }
Example #5
0
        public void CurrentErrorTest()
        {
            NeuralEventArgs target   = new NeuralEventArgs(); // TODO: Initialize to an appropriate value
            double          expected = 0F;                    // TODO: Initialize to an appropriate value
            double          actual;

            target.CurrentError = expected;
            actual = target.CurrentError;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Example #6
0
        public void StopTest()
        {
            NeuralEventArgs target   = new NeuralEventArgs(); // TODO: Initialize to an appropriate value
            bool            expected = false;                 // TODO: Initialize to an appropriate value
            bool            actual;

            target.Stop = expected;
            actual      = target.Stop;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Example #7
0
        public void CurrentIterationTest()
        {
            NeuralEventArgs target   = new NeuralEventArgs(); // TODO: Initialize to an appropriate value
            int             expected = 0;                     // TODO: Initialize to an appropriate value
            int             actual;

            target.CurrentIteration = expected;
            actual = target.CurrentIteration;
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public bool Train()
        {
            double          currentError     = 0;
            int             currentIteration = 0;
            NeuralEventArgs Args             = new NeuralEventArgs();

            do
            {
                currentError = 0;
                foreach (FaceImage face in _trainingSet)
                {
                    _neuralNet.ForwardPropagate(face.VectorInNet, face.PersonId);
                    _neuralNet.BackPropagate();
                    currentError += _neuralNet.GetError();
                }

                currentIteration++;

                if (IterationChanged != null && currentIteration % 5 == 0)
                {
                    Args.CurrentError     = currentError;
                    Args.CurrentIteration = currentIteration;
                    IterationChanged(this, Args);
                }
            } while (currentError > _maxError && currentIteration < _maxIter && !Args.Stop);

            if (IterationChanged != null)
            {
                Args.CurrentError     = currentError;
                Args.CurrentIteration = currentIteration;
                IterationChanged(this, Args);
            }

            if (currentIteration >= _maxIter || Args.Stop)
            {
                return(false);//Training Not Successful
            }
            return(true);
        }
 private void neuralNetwork_IterationChanged(object sender, NeuralEventArgs args)
 {
     UpdateError(args.CurrentError);
     UpdateIteration(args.CurrentIteration);
 }
Example #10
0
        public void NeuralEventArgsConstructorTest1()
        {
            NeuralEventArgs target = new NeuralEventArgs();

            Assert.Inconclusive("TODO: Implement code to verify target");
        }
Example #11
0
 void neuralNetwork_IterationChanged(object o, NeuralEventArgs args)
 {
 }