Product() public static method

Computes the product of two vectors given in sparse representation.
public static Product ( double x, double y ) : double
x double The first vector x.
y double The second vector y.
return double
Ejemplo n.º 1
0
        /// <summary>
        ///   Sigmoid kernel function.
        /// </summary>
        ///
        /// <param name="x">Vector <c>x</c> in input space.</param>
        /// <param name="y">Vector <c>y</c> in input space.</param>
        /// <returns>Dot product in feature (kernel) space.</returns>
        ///
        public override double Function(double[] x, double[] y)
        {
#pragma warning disable 0618

            double sum = SparseLinear.Product(x, y);

            return(System.Math.Tanh(Gamma * sum + Constant));
        }
Ejemplo n.º 2
0
        /// <summary>
        ///   Polynomial kernel function.
        /// </summary>
        ///
        /// <param name="x">Vector <c>x</c> in input space.</param>
        /// <param name="y">Vector <c>y</c> in input space.</param>
        /// <returns>Dot product in feature (kernel) space.</returns>
        ///
        public override double Function(double[] x, double[] y)
        {
#pragma warning disable 0618

            double sum = SparseLinear.Product(x, y) + constant;

            return(Math.Pow(sum, Degree));
        }
Ejemplo n.º 3
0
        /// <summary>
        ///   Polynomial kernel function.
        /// </summary>
        ///
        /// <param name="x">Vector <c>x</c> in input space.</param>
        /// <param name="y">Vector <c>y</c> in input space.</param>
        /// <returns>Dot product in feature (kernel) space.</returns>
        ///
        public override double Function(double[] x, double[] y)
        {
            double sum = SparseLinear.Product(x, y) + constant;

            return(Math.Pow(sum, Degree));
        }