Class SummationKernel
Summation kernel. This provides the management layer for adding together different kernels
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions.Kernels
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
public class SummationKernel : KernelFunction, IKernelFunctionWithParams, IKernelFunction
Constructors
SummationKernel()
Default constructor
Declaration
public SummationKernel()
SummationKernel(IKernelFunctionWithParams)
Constructs summation kernel from an initial kernel function
Declaration
public SummationKernel(IKernelFunctionWithParams kernel)
Parameters
Type | Name | Description |
---|---|---|
IKernelFunctionWithParams | kernel |
SummationKernel(List<IKernelFunctionWithParams>)
Declaration
[Construction(new string[]{"Kernels"})]
public SummationKernel(List<IKernelFunctionWithParams> kernels)
Parameters
Type | Name | Description |
---|---|---|
List<IKernelFunctionWithParams> | kernels |
Fields
indexInKernel
Index of a hyper-parameter within a participating kernel
Declaration
protected int[] indexInKernel
Field Value
Type | Description |
---|---|
Int32[] |
indexOfKernel
Index of the kernel to which the hyper-parameter belongs
Declaration
protected int[] indexOfKernel
Field Value
Type | Description |
---|---|
Int32[] |
kernels
List of kernels in the summation
Declaration
protected List<IKernelFunctionWithParams> kernels
Field Value
Type | Description |
---|---|
List<IKernelFunctionWithParams> |
thetaCount
Parameter counts of the individual kernels
Declaration
protected int[] thetaCount
Field Value
Type | Description |
---|---|
Int32[] |
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 | parameter index |
Property Value
Type | Description |
---|---|
Double |
Overrides
Item[String]
Set or get hyper-parameter by name. This indexer is not over-rideable
Declaration
public override double this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
String | name | Mame of the hyper-parameter |
Property Value
Type | Description |
---|---|
Double | The hyper-parameter value |
Overrides
Kernels
The participating kernels
Declaration
public virtual IList<IKernelFunctionWithParams> Kernels { get; }
Property Value
Type | Description |
---|---|
IList<IKernelFunctionWithParams> |
ThetaCount
Number of theta parameters
Declaration
public override int ThetaCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
TypeVersion
The static version for the derived class
Declaration
public override int TypeVersion { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
Methods
buildMaps()
Helper method for building maps between container and containees
Declaration
protected void buildMaps()
clearMaps()
Clear maps between container and containees
Declaration
protected void clearMaps()
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
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
initialise()
(Re-)initialise a summation kernel. This clears all participating kernels
Declaration
protected void initialise()
Read(StreamReader)
Reads the function parameters in from a stream
Declaration
public override void Read(StreamReader sr)
Parameters
Type | Name | Description |
---|---|---|
StreamReader | sr | Stream reader |
Overrides
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Write(StreamWriter)
Writes the function parameters out to a stream
Declaration
public override void Write(StreamWriter sw)
Parameters
Type | Name | Description |
---|---|---|
StreamWriter | sw | Stream writer |
Overrides
Operators
Addition(SummationKernel, IKernelFunctionWithParams)
Adds two kernel functions
Declaration
public static SummationKernel operator +(SummationKernel kernelA, IKernelFunctionWithParams kernelB)
Parameters
Type | Name | Description |
---|---|---|
SummationKernel | kernelA | |
IKernelFunctionWithParams | kernelB |
Returns
Type | Description |
---|---|
SummationKernel |