Kernels

Kern_Linear

class Kern_Linear : public Kern_Base

Linear kernel also knows as dot product kernel

Defined for two vectors x and y:

\[ K(\mathbf{x}, \mathbf{y}) = \mathbf{x}^T \mathbf{y} = \sum_i x^{(i)} y^{(i)} \]

See also

Kern_Base BF_Linear

Public Functions

virtual double operator()(const aed_rctype &b, const aed_rctype &af)

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype&)

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff)

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual std::string get_label()

Return label of this object.

inline virtual void set_basis(const aeds_type)

Set basis for calculations.

Public Members

std::string label = "Kern_Linear"

Label used for this class

Kern_Quadratic

class Kern_Quadratic : public Kern_Base

Quadratic kernel - special case of 2nd order polynomial kernel

Defined for two vectors x and y:

\[ K(\mathbf{x}, \mathbf{y}) = \Big( \mathbf{x}^T \mathbf{y} \Big)^2 = \Big( \sum_i x^{(i)} y^{(i)} \Big)^2 \]

See also

Kern_Base

Public Functions

virtual double operator()(const aed_rctype &b, const aed_rctype &af)

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af)

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff)

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual std::string get_label()

Return label of this object.

Public Members

std::string label = "Kern_Quadratic"

Label used for this class

Kern_LQ

class Kern_LQ : public Kern_Base

Linear + Quadratic kernel

Defined for two vectors x and y:

\[ K(\mathbf{x}, \mathbf{y}) = \mathbf{x}^T \mathbf{y} + \Big(\mathbf{x}^T \mathbf{y} \Big)^2 = \sum_i x^{(i)} y^{(i)} + \Big(\sum_i x^{(i)} y^{(i)} \Big)^2 \]

Public Functions

virtual double operator()(const aed_rctype &b, const aed_rctype &af)

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af)

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff)

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual std::string get_label()

Return label of this object.

Public Members

std::string label = "Kern_LQ"

Label used for this class

Kern_RBF

class Kern_RBF : public Kern_Base

Radial Basis Function kernel.

Defined for two vectors x and y:

\[ K(\mathbf{x}, \mathbf{y}) = \exp\Big( -\frac{||\mathbf{x}-\mathbf{y}||^2} {2\sigma^2} \Big) \]

Required Config key: MPARAMS <double> \( \sigma \)

Public Functions

Kern_RBF()

Label used for this class

virtual double operator()(const aed_rctype &b, const aed_rctype &af)

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af)

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff)

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual std::string get_label()

Return label of this object.

Kern_Polynomial

class Kern_Polynomial : public Kern_Base

Polynomial kernel.

Defined for two vectors x and y:

\[ K(\mathbf{x}, \mathbf{y}) = \big( \gamma*\mathbf{x}^T \mathbf{y} + \mathrm{c} \big)^{\mathrm{d}} \]

Required Config key: MPARAMS <int> d <double> \( \gamma \) c

See also

Kern_Base

Public Functions

virtual double operator()(const aed_rctype &b, const aed_rctype &af)

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af)

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff)

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual std::string get_label()

Return label of this object.

Public Members

std::string label = "Kern_Polynomial"

Label used for this class

Kern_Sigmoid

class Kern_Sigmoid : public Kern_Base

Sigmoid kernel.

Defined for two vectors x and y:

\[ K(\mathbf{x}, \mathbf{y}) = \tanh\big( \gamma*\mathbf{x}^T \mathbf{y} + \mathrm{c} \big) \]

Required Config key: MPARAMS <double> \( \gamma \) c

See also

Kern_Base

Public Functions

Kern_Sigmoid()

Label used for this class

virtual double operator()(const aed_rctype &b, const aed_rctype &af)

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af)

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff)

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual std::string get_label()

Return label of this object.

Kernel

class Kern_Base : public Func_Base

Abstract class to be used as a base for all kernels.

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor

  • all derivatives are defined wrt to the second argument

Subclassed by Kern_LQ, Kern_Linear, Kern_Polynomial, Kern_Quadratic, Kern_RBF, Kern_Sigmoid

Public Functions

virtual double operator()(const aed_rctype &b, const aed_rctype &af) = 0

Calculate kernel value given two vectors

  • b = basis vector

  • af = atomic energy descriptor

virtual aed_type derivative(const aed_rctype &b, const aed_rctype &af) = 0

Calculate the kernel derivative wrt to the second argument

  • b = basis vector

  • af = atomic energy descriptor

virtual double prime(const aed_rctype &b, const aed_rctype &af, const aed_rctype &ff) = 0

Calculate inner product of the kernel derivative wrt to the second argument (b wrt af) with the force descriptor

  • b = basis vector

  • af = atomic energy descriptor

  • ff = force descriptor (TODO i-th dir component of it) TODO consider calculating all 3-directions at once

virtual void set_basis(const aeds_type b)

Set basis for calculations.

virtual std::string get_label() = 0

Return label of this object.