Exemple #1
0
        /// <summary>
        /// 学習データを与えて初期化
        /// </summary>
        /// <param name="layerSizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
        /// <param name="activFunc">各ニューロンの活性化関数</param>
        /// <param name="fParam1">活性化関数のフリーパラメータα</param>
        /// <param name="fParam2">活性化関数のフリーパラメータβ</param>
#else
		/// <summary>
        /// Training constructor
        /// </summary>
        /// <param name="layerSizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
        /// <param name="activFunc">Specifies the activation function for each neuron</param>
        /// <param name="fParam1">Free parameter α of the activation function</param>
		/// <param name="fParam2">Free parameter β of the activation function</param>
#endif
		public CvANN_MLP(
            CvMat layerSizes, 
            MLPActivationFunc activFunc = MLPActivationFunc.SigmoidSym, 
            double fParam1 = 0, double fParam2 = 0)
		{
            if (layerSizes == null)
                throw new ArgumentNullException("layerSizes");

            ptr = NativeMethods.ml_CvANN_MLP_new2_CvMat(
                layerSizes.CvPtr, (int)activFunc, fParam1, fParam2);
		}
Exemple #2
0
        /// <summary>
        /// 学習データを与えて初期化
        /// </summary>
        /// <param name="layerSizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
        /// <param name="activFunc">各ニューロンの活性化関数</param>
        /// <param name="fParam1">活性化関数のフリーパラメータα</param>
        /// <param name="fParam2">活性化関数のフリーパラメータβ</param>
#else
        /// <summary>
        /// Training constructor
        /// </summary>
        /// <param name="layerSizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
        /// <param name="activFunc">Specifies the activation function for each neuron</param>
        /// <param name="fParam1">Free parameter α of the activation function</param>
        /// <param name="fParam2">Free parameter β of the activation function</param>
#endif
        public CvANN_MLP(
            CvMat layerSizes,
            MLPActivationFunc activFunc = MLPActivationFunc.SigmoidSym,
            double fParam1 = 0, double fParam2 = 0)
        {
            if (layerSizes == null)
            {
                throw new ArgumentNullException("layerSizes");
            }

            ptr = NativeMethods.ml_CvANN_MLP_new2_CvMat(
                layerSizes.CvPtr, (int)activFunc, fParam1, fParam2);
        }
Exemple #3
0
        /// <summary>
        /// 指定したトポロジーでMLPを構築する
        /// </summary>
        /// <param name="layerSizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
        /// <param name="activFunc">各ニューロンの活性化関数</param>
        /// <param name="fParam1">活性化関数のフリーパラメータα</param>
        /// <param name="fParam2">活性化関数のフリーパラメータβ</param>
#else
        /// <summary>
        /// Constructs the MLP with the specified topology
        /// </summary>
        /// <param name="layerSizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
        /// <param name="activFunc">Specifies the activation function for each neuron</param>
        /// <param name="fParam1">Free parameter α of the activation function</param>
        /// <param name="fParam2">Free parameter β of the activation function</param>
#endif
        public void Create(
            Mat layerSizes,
            MLPActivationFunc activFunc = MLPActivationFunc.SigmoidSym,
            double fParam1 = 0, double fParam2 = 0)
        {
            if (disposed)
            {
                throw new ObjectDisposedException("StatModel");
            }
            if (layerSizes == null)
            {
                throw new ArgumentNullException("layerSizes");
            }
            layerSizes.ThrowIfDisposed();

            NativeMethods.ml_CvANN_MLP_create_Mat(
                ptr, layerSizes.CvPtr, (int)activFunc, fParam1, fParam2);
        }
Exemple #4
0
        /// <summary>
        /// 指定したトポロジーでMLPを構築する
        /// </summary>
        /// <param name="layerSizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
        /// <param name="activFunc">各ニューロンの活性化関数</param>
        /// <param name="fParam1">活性化関数のフリーパラメータα</param>
        /// <param name="fParam2">活性化関数のフリーパラメータβ</param>
#else
        /// <summary>
        /// Constructs the MLP with the specified topology
        /// </summary>
        /// <param name="layerSizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
        /// <param name="activFunc">Specifies the activation function for each neuron</param>
        /// <param name="fParam1">Free parameter α of the activation function</param>
        /// <param name="fParam2">Free parameter β of the activation function</param>
#endif
        public void Create(
            Mat layerSizes,
            MLPActivationFunc activFunc = MLPActivationFunc.SigmoidSym,
            double fParam1 = 0, double fParam2 = 0)
        {
            if (disposed)
                throw new ObjectDisposedException("StatModel");
            if (layerSizes == null)
                throw new ArgumentNullException("layerSizes");
            layerSizes.ThrowIfDisposed();

            NativeMethods.ml_CvANN_MLP_create_Mat(
                ptr, layerSizes.CvPtr, (int)activFunc, fParam1, fParam2);
        }
Exemple #5
0
        /// <summary>
        /// 学習データを与えて初期化
        /// </summary>
        /// <param name="layer_sizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
		/// <param name="activ_func">各ニューロンの活性化関数</param>
#else
		/// <summary>
        /// Training constructor
        /// </summary>
        /// <param name="layer_sizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
		/// <param name="activ_func">Specifies the activation function for each neuron</param>
#endif
		public CvANN_MLP(CvMat layer_sizes, MLPActivationFunc activ_func)
            : this(layer_sizes, activ_func, 0, 0)
		{    
		}
Exemple #6
0
        /// <summary>
        /// 指定したトポロジーでMLPを構築する
        /// </summary>
        /// <param name="layer_sizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
		/// <param name="activ_func">各ニューロンの活性化関数</param>
        /// <param name="f_param1">活性化関数のフリーパラメータα</param>
		/// <param name="f_param2">活性化関数のフリーパラメータβ</param>
#else
		/// <summary>
        /// Constructs the MLP with the specified topology
        /// </summary>
        /// <param name="layerSizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
		/// <param name="activFunc">Specifies the activation function for each neuron</param>
        /// <param name="fParam1">Free parameter α of the activation function</param>
		/// <param name="fParam2">Free parameter β of the activation function</param>
#endif
		public void Create(CvMat layerSizes, MLPActivationFunc activFunc, Double fParam1, Double fParam2)
		{    
			if (layerSizes == null)
                throw new ArgumentNullException("layerSizes");

			MLInvoke.CvANN_MLP_create(ptr, layerSizes.CvPtr, (int)activFunc, fParam1, fParam2);
		}
Exemple #7
0
        /// <summary>
        /// 指定したトポロジーでMLPを構築する
        /// </summary>
        /// <param name="layer_sizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
		/// <param name="activ_func">各ニューロンの活性化関数</param>
#else
		/// <summary>
        /// Constructs the MLP with the specified topology
        /// </summary>
        /// <param name="layerSizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
		/// <param name="activFunc">Specifies the activation function for each neuron</param>
#endif
		public void Create(CvMat layerSizes, MLPActivationFunc activFunc)
		{    
			Create( layerSizes, activFunc, 0, 0 );
		}
Exemple #8
0
        /// <summary>
        /// 学習データを与えて初期化
        /// </summary>
        /// <param name="layer_sizes">入出力層を含む各層のニューロン数を指定する整数のベクトル</param>
		/// <param name="activ_func">各ニューロンの活性化関数</param>
        /// <param name="f_param1">活性化関数のフリーパラメータα</param>
		/// <param name="f_param2">活性化関数のフリーパラメータβ</param>
#else
		/// <summary>
        /// Training constructor
        /// </summary>
        /// <param name="layer_sizes">The integer vector specifies the number of neurons in each layer including the input and output layers. </param>
		/// <param name="activ_func">Specifies the activation function for each neuron</param>
        /// <param name="f_param1">Free parameter α of the activation function</param>
		/// <param name="f_param2">Free parameter β of the activation function</param>
#endif
		public CvANN_MLP(CvMat layer_sizes, MLPActivationFunc activ_func, double f_param1, double f_param2)
		{    
			if (layer_sizes == null)
                throw new ArgumentNullException("layer_sizes");

			this.ptr = MLInvoke.CvANN_MLP_construct_training(layer_sizes.CvPtr, (int)activ_func, f_param1, f_param2 );
			base.NotifyMemoryPressure(SizeOf);
		}