Search Results for

    Show / Hide Table of Contents

    Class LinearKernel

    Linear kernel

    Inheritance
    Object
    KernelFunction
    LinearKernel
    Implements
    IKernelFunctionWithParams
    IKernelFunction
    Inherited Members
    KernelFunction.thetaNames
    KernelFunction.thetaValues
    KernelFunction.thetaName2Index
    KernelFunction.HyperNames
    KernelFunction.EvaluateX1X2(Vector, Vector)
    KernelFunction.EvaluateX1X2(Vector, Vector, Vector)
    KernelFunction.EvaluateX(Vector)
    KernelFunction.EvaluateX(Vector, Vector)
    KernelFunction.Item[String]
    KernelFunction.NameToIndex(String)
    KernelFunction.IndexToName(Int32)
    KernelFunction.ThetaCount
    KernelFunction.Write(StreamWriter)
    KernelFunction.Cholesky(IKernelFunction, Dictionary<Int32, Vector>)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Distributions.Kernels
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    [Serializable]
    public class LinearKernel : KernelFunction, IKernelFunctionWithParams, IKernelFunction

    Constructors

    LinearKernel()

    Default constructor

    Declaration
    public LinearKernel()

    LinearKernel(Double[])

    Constructs a linear kernel from vector of log variances

    Declaration
    public LinearKernel(double[] logVariances)
    Parameters
    Type Name Description
    Double[] logVariances

    Log of the weight variances

    Properties

    Item[Int32]

    Sets or gets a log hyper-parameter by index

    Declaration
    public override double this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index
    Property Value
    Type Description
    Double
    Overrides
    KernelFunction.Item[Int32]

    TypeVersion

    The static version for the derived class

    Declaration
    public override int TypeVersion { get; }
    Property Value
    Type Description
    Int32
    Overrides
    KernelFunction.TypeVersion

    Methods

    EvaluateX(Vector, ref Vector, ref Vector)

    Evaluates the kernel for a single vector (which is used for both slots)

    Declaration
    public override double EvaluateX(Vector x, ref Vector xDeriv, ref Vector logThetaDeriv)
    Parameters
    Type Name Description
    Vector x

    Vector

    Vector xDeriv

    Derivative of the kernel value with respect to x

    Vector logThetaDeriv

    Derivative of the kernel value with respect to the log hyper-parameters

    Returns
    Type Description
    Double
    Overrides
    KernelFunction.EvaluateX(Vector, ref Vector, ref Vector)

    EvaluateX1X2(Vector, Vector, ref Vector, ref Vector)

    Evaluates the kernel for a pair of vectors

    Declaration
    public override double EvaluateX1X2(Vector x1, Vector x2, ref Vector x1Deriv, ref Vector logThetaDeriv)
    Parameters
    Type Name Description
    Vector x1

    First vector

    Vector x2

    Second vector

    Vector x1Deriv

    Derivative of the kernel value with respect to x1 input vector

    Vector logThetaDeriv

    Derivative of the kernel value with respect to the log hyper-parameters

    Returns
    Type Description
    Double
    Overrides
    KernelFunction.EvaluateX1X2(Vector, Vector, ref Vector, ref Vector)

    InitialiseFromData(IList<Vector>)

    Initialises the parameters from data. The variance is set as the square of the inverse of the 'length' of the input feature. Note that the variance we are trying to set up here corresponds to the variance of the weight parameters in a linear model, not to the variance of the input feature.

    Declaration
    public void InitialiseFromData(IList<Vector> X)
    Parameters
    Type Name Description
    IList<Vector> X

    X data - initialises variances

    Read(StreamReader)

    Reads the parameters in from a stream

    Declaration
    public override void Read(StreamReader sr)
    Parameters
    Type Name Description
    StreamReader sr

    Stream reader

    Overrides
    KernelFunction.Read(StreamReader)

    SetupParams(Double[])

    Sets up names and values of parameters

    Declaration
    public void SetupParams(double[] logVariances)
    Parameters
    Type Name Description
    Double[] logVariances

    Log of the weight variances

    Implements

    IKernelFunctionWithParams
    IKernelFunction
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.