Diagonal#

class hmclab.MassMatrices.Diagonal(diagonal: numpy.ndarray, rng: Optional[numpy.random._generator.Generator] = None)[source]#

Bases: hmclab.MassMatrices._AbstractMassMatrix

The diagonal mass matrix.

This mass matrix or metric does only performs scaling on each dimension separately. It is optimal when all parameters of your target distribution are expected to be independent (not have trade-offs) but still varying scales of disperion / variance.

__init__(diagonal: numpy.ndarray, rng: Optional[numpy.random._generator.Generator] = None)[source]#

Constructor for diagonal mass matrices.

Methods

__init__

Constructor for diagonal mass matrices.

create_default

full_name

generate_momentum

kinetic_energy

param momentum

kinetic_energy_gradient

param momentum

Attributes

dimensions

matrix

name

rng

kinetic_energy(momentum: numpy.ndarray) float[source]#
Parameters

momentum

kinetic_energy_gradient(momentum: numpy.ndarray) numpy.ndarray[source]#
Parameters

momentum

generate_momentum() numpy.ndarray[source]#