Exemple #1
0
        /// <summary>
        ///   Creates a Mixed-Bernoulli network.
        /// </summary>
        ///
        /// <param name="visible">The <see cref="IStochasticFunction"/> to be used in the first visible layer.</param>
        /// <param name="hidden">The <see cref="IStochasticFunction"/> to be used in all other layers.</param>
        ///
        /// <param name="inputsCount">The number of inputs for the network.</param>
        /// <param name="hiddenNeurons">The number of hidden neurons in each layer.</param>
        ///
        public static DeepBeliefNetwork CreateMixedNetwork(IStochasticFunction visible,
                                                           IStochasticFunction hidden, int inputsCount, params int[] hiddenNeurons)
        {
            DeepBeliefNetwork network = new DeepBeliefNetwork(hidden, inputsCount, hiddenNeurons);

            foreach (StochasticNeuron neuron in network.machines[0].Visible.Neurons)
            {
                neuron.ActivationFunction = visible;
            }

            return(network);
        }
Exemple #2
0
        /// <summary>
        ///   Creates a Gaussian-Bernoulli network.
        /// </summary>
        ///
        /// <param name="inputsCount">The number of inputs for the network.</param>
        /// <param name="hiddenNeurons">The number of hidden neurons in each layer.</param>
        ///
        public static DeepBeliefNetwork CreateGaussianBernoulli(int inputsCount, params int[] hiddenNeurons)
        {
            DeepBeliefNetwork network = new DeepBeliefNetwork(inputsCount, hiddenNeurons);

            GaussianFunction gaussian = new GaussianFunction();

            foreach (StochasticNeuron neuron in network.machines[0].Visible.Neurons)
            {
                neuron.ActivationFunction = gaussian;
            }

            return(network);
        }