Class NNKernel
Neural Net kernel
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions.Kernels
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
public class NNKernel : KernelFunction, IKernelFunctionWithParams, IKernelFunction
Constructors
NNKernel()
Default constructor
Declaration
public NNKernel()
NNKernel(Double[], Double)
Constructs an neural net kernel from vector of log lweight variances
Declaration
public NNKernel(double[] logWeightVariances, double logBiasWeightVariance)
Parameters
Type | Name | Description |
---|---|---|
Double[] | logWeightVariances | Log weight variances |
Double | logBiasWeightVariance | Log bias 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
TypeVersion
The static version for the derived class
Declaration
public override int TypeVersion { get; }
Property Value
Type | Description |
---|---|
Int32 |
Overrides
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
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
GetLogBiasWeightVariance()
Gets the log bias variances from this Neural Net kernel instance
Declaration
public double GetLogBiasWeightVariance()
Returns
Type | Description |
---|---|
Double |
GetLogWeightVariances()
Gets the log weight variances from this Neural Net kernel instance
Declaration
public double[] GetLogWeightVariances()
Returns
Type | Description |
---|---|
Double[] |
InitialiseFromData(IList<Vector>)
Initialises the parameters from data
Declaration
public void InitialiseFromData(IList<Vector> X)
Parameters
Type | Name | Description |
---|---|---|
IList<Vector> | X | X data - initialises weight 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
SetupParams(Double[], Double)
Sets up names and values of parameters
Declaration
public void SetupParams(double[] logWeightVariances, double logBiasWeightVariance)
Parameters
Type | Name | Description |
---|---|---|
Double[] | logWeightVariances | Log weight variances |
Double | logBiasWeightVariance | Log bias weight variance |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |