public void Compute()
        {
            if (!CanCompute)
            {
                return;
            }

            double[]          input    = UserInput;
            DeepBeliefNetwork network  = Main.Network;
            IDatabase         database = Main.Database;

            database.Normalize(input);

            {
                double[] output         = network.GenerateOutput(input);
                double[] reconstruction = network.Reconstruct(output);
                NetworkOutput = (database.ToBitmap(reconstruction).ToBitmapImage());
            }

            if (Main.CanClassify)
            {
                double[] output = network.Compute(input);
                int      imax; output.Max(out imax);
                Classification = imax;
            }
        }
Exemple #2
0
        /// <summary>
        /// Implementation of the divergence operation.
        /// </summary>
        protected override void diverge()
        {
            //convert all the modalities in a single vector
            double[] realSignal; double[] predictedSignal;
            getConcatenatedModalities(out realSignal, out predictedSignal);

            //Generate the prediction
            double[] output            = network.GenerateOutput(realSignal, 0);
            double[] networkPrediction = network.Reconstruct(output);

            //Distribute it over the Signal
            setConcatenatedModalities(null, networkPrediction);

            //Proceed to learning
            if (!learningLocked && learningRate > 0)
            {
                //teacher.Run(realSignal);
                //network.UpdateVisibleWeights();
            }
        }