JWS C Library
C language utility library
|
Collection of functions for stochastic dynamics on a function to generate random samples. More...
#include <jwsc/config.h>
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <math.h>
#include <assert.h>
#include "jwsc/base/error.h"
#include "jwsc/base/limits.h"
#include "jwsc/vector/vector.h"
#include "jwsc/vector/vector_math.h"
#include "jwsc/vector/vector_io.h"
#include "jwsc/matrix/matrix.h"
#include "jwsc/prob/pdf.h"
#include "jwsc/prob/mv_pdf.h"
#include "jwsc/stat/dynamics.h"
Go to the source code of this file.
Functions | |
stochastic_dynamics | |
Leapfrog discretization of stochastic dynamics to sample from an energy function. | |
Error * | stochastic_dynamics_1_d (uint32_t iterations, double delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params)) |
Double precision leapfrog stochastic dynamics. | |
Error * | stochastic_dynamics_2_d (uint32_t iterations, const Vector_d *delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params)) |
Double precision leapfrog stochastic dynamics. | |
hybrid_monte_carlo | |
Stochastic dynamics combined with Metropolis-Hastings for quickly converging and unbiased sampling. | |
Error * | hybrid_monte_carlo_1_d (uint32_t iterations, uint32_t leap_iter, double delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params), Error *(*reject_sample)(const Vector_d *sample, const Vector_d *momenta, void *params)) |
Double precision hybrid monte carlo. | |
Error * | hybrid_monte_carlo_2_d (uint32_t iterations, uint32_t leap_iter, const Vector_d *delta_t, double alpha, uint32_t kick, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, const Vector_d *momenta, void *params), Error *(*reject_sample)(const Vector_d *sample, const Vector_d *momenta, void *params)) |
Double precision hybrid monte carlo. | |
langevin | |
Langevin dynamics for generating samples from an energy function. | |
Error * | langevin_1_f (uint32_t iterations, float delta_t, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params)) |
Single precision Langevin dynamics. | |
Error * | langevin_2_f (uint32_t iterations, const Vector_f *delta_t, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params)) |
Single precision Langevin dynamics. | |
Error * | langevin_1_d (uint32_t iterations, double delta_t, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params)) |
Double precision Langevin dynamics. | |
Error * | langevin_2_d (uint32_t iterations, const Vector_d *delta_t, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params)) |
Double precision Langevin dynamics. | |
hyperdynamics_hessian_eigenvalue | |
Estimates the lowest eigenvalue for the energy function Hessian matrix. | |
static Error * | hyperdynamics_hessian_eigenvalue_f (float *e_out, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *)) |
static Error * | hyperdynamics_hessian_eigenvalue_d (double *e_out, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *)) |
hyperdynamics_hessian_eigenvector | |
Estimates the lowest eigenvector for the energy function Hessian matrix. | |
static Error * | hyperdynamics_hessian_eigenvector_f (Vector_f **v_out, float eta, float gamma, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), Error *(*grad_energy_func)(Vector_f **, void *)) |
static Error * | hyperdynamics_hessian_eigenvector_d (Vector_d **v_out, double eta, double gamma, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), Error *(*grad_energy_func)(Vector_d **, void *)) |
hyperdynamics_dx_hessian_eigenvalue | |
Estimates the gradient of the lowest eigenvalue for the energy function Hessian matrix w.r.t. the parameters. | |
static Error * | hyperdynamics_dx_hessian_eigenvalue_f (Vector_f **e_dx_out, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*grad_energy_func)(Vector_f **, void *)) |
static Error * | hyperdynamics_dx_hessian_eigenvalue_d (Vector_d **e_dx_out, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*grad_energy_func)(Vector_d **, void *)) |
hyperdynamics_hessgrad_eigenvalue | |
Estimates the lowest eigenvalue for the energy function Hessian matrix plus the gradient (squared) matrix w.r.t. the parameters. | |
static Error * | hyperdynamics_hessgrad_eigenvalue_f (float *e_out, float lambda, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), uint8_t positive) |
static Error * | hyperdynamics_hessgrad_eigenvalue_d (double *e_out, double lambda, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), uint8_t positive) |
static Error * | hyperdynamics_dx_hessgrad_eigenvalue_f (Vector_f **e_lambda_dx_out, float lambda, const Vector_f *v, float eta, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), Error *(*grad_energy_func)(Vector_f **, void *), uint8_t positive) |
static Error * | hyperdynamics_dx_hessgrad_eigenvalue_d (Vector_d **e_lambda_dx_out, double lambda, const Vector_d *v, double eta, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), Error *(*grad_energy_func)(Vector_d **, void *), uint8_t positive) |
hyperdynamics_proj_hessian_eigenvector | |
Estimates the projected gradient vector on the lowest eigenvector of the Hessian matrix. | |
static Error * | hyperdynamics_proj_hessian_eigenvector_f (float *g1p_out, float e_pos, float e_neg, float lambda) |
static Error * | hyperdynamics_proj_hessian_eigenvector_d (double *g1p_out, double e_pos, double e_neg, double lambda) |
hyperdynamics_hessgrad_eigenvector | |
Estimates the lowest eigenvector for the energy function Hessian matrix plus the gradient (squared) matrix w.r.t. the parameters. | |
static Error * | hyperdynamics_hessgrad_eigenvector_f (float *lambda_out, Vector_f **v_pos_out, Vector_f **v_neg_out, float eta, float gamma, void *params, void(*get_pt_from_params)(Vector_f **, const void *), Error *(*set_params_from_pt)(const Vector_f *, void *), Error *(*energy_func)(float *, void *), Error *(*grad_energy_func)(Vector_f **, void *)) |
static Error * | hyperdynamics_hessgrad_eigenvector_d (double *lambda_out, Vector_d **v_pos_out, Vector_d **v_neg_out, double eta, double gamma, void *params, void(*get_pt_from_params)(Vector_d **, const void *), Error *(*set_params_from_pt)(const Vector_d *, void *), Error *(*energy_func)(double *, void *), Error *(*grad_energy_func)(Vector_d **, void *)) |
hyperdynamics_dx_proj_hessian_eigenvector | |
Estimates the derivative of the projected gradient vector on the lowest eigenvector of the Hessian matrix. | |
static Error * | hyperdynamics_dx_proj_hessian_eigenvector_f (Vector_f **g1p_dx_out, const Vector_f *e_pos_dx, const Vector_f *e_neg_dx, float g1p, float lambda) |
static Error * | hyperdynamics_dx_proj_hessian_eigenvector_d (Vector_d **g1p_dx_out, const Vector_d *e_pos_dx, const Vector_d *e_neg_dx, double g1p, double lambda) |
langevin_hyperdynamics | |
Voter's hyperdynamics biasing for generating samples from an energy function using Langevin dynamics. | |
Error * | langevin_hyperdynamics_1_f (uint32_t iterations, float delta_t, float gamma, float eta, float h, float d, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_f *p, void *params), Error *(*energy_func)(float *energy_out, void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params, float energy_bias)) |
Single precision Voter hyperdynamics. | |
Error * | langevin_hyperdynamics_2_f (uint32_t iterations, const Vector_f *delta_t, float gamma, float eta, float h, float d, void *params, void(*get_pt_from_params)(Vector_f **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_f *p, void *params), Error *(*energy_func)(float *energy_out, void *params), Error *(*grad_energy_func)(Vector_f **grad_out, void *params), Error *(*accept_sample)(const Vector_f *sample, void *params, float energy_bias)) |
Single precision Voter hyperdynamics. | |
Error * | langevin_hyperdynamics_1_d (uint32_t iterations, double delta_t, double gamma, double eta, double h, double d, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params, double energy_bias)) |
Double precision Voter hyperdynamics. | |
Error * | langevin_hyperdynamics_2_d (uint32_t iterations, const Vector_d *delta_t, double gamma, double eta, double h, double d, void *params, void(*get_pt_from_params)(Vector_d **p_out, const void *params), Error *(*set_params_from_pt)(const Vector_d *p, void *params), Error *(*energy_func)(double *energy_out, void *params), Error *(*grad_energy_func)(Vector_d **grad_out, void *params), Error *(*accept_sample)(const Vector_d *sample, void *params, double energy_bias)) |
Double precision Voter hyperdynamics. |
Collection of functions for stochastic dynamics on a function to generate random samples.
Definition in file dynamics.c.
Error* stochastic_dynamics_1_d | ( | uint32_t | iterations, |
double | delta_t, | ||
double | alpha, | ||
uint32_t | kick, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params) | accept_sample | ||
) |
Double precision leapfrog stochastic dynamics.
See Neal '93 for details.
Preserves phase space volume.
iterations | Number of leapfrog steps to take; number of samples to generate. |
delta_t | Time discretization step size. |
alpha | Parameter for stochastic dynamics. Should be in in the interval [0,1]. |
kick | Frequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 97 of file dynamics.c.
Error* stochastic_dynamics_2_d | ( | uint32_t | iterations, |
const Vector_d * | delta_t, | ||
double | alpha, | ||
uint32_t | kick, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params) | accept_sample | ||
) |
Double precision leapfrog stochastic dynamics.
See Neal '93 for details.
Preserves phase space volume.
iterations | Number of leapfrog steps to take; number of samples to generate. |
delta_t | Time discretization step size. |
alpha | Parameter for stochastic dynamics. Should be in in the interval [0,1]. |
kick | Frequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 152 of file dynamics.c.
Error* hybrid_monte_carlo_1_d | ( | uint32_t | iterations, |
uint32_t | leap_iter, | ||
double | delta_t, | ||
double | alpha, | ||
uint32_t | kick, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(const Vector_d *p, void *params) | set_params_from_pt, | ||
Error *(*)(double *energy_out, void *params) | energy_func, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params) | accept_sample, | ||
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params) | reject_sample | ||
) |
Double precision hybrid monte carlo.
See Neal '93 for details.
Preserves phase space volume and generates unbiased samples.
iterations | Number of Metropolis-Hastings iterations. Proportional to the number of samples generated, depending on the rejection rate. |
leap_iter | Number of leapfrog iterations between each Metropolis-Hastings iterations. |
delta_t | Time discretization step size. |
alpha | Parameter for stochastic dynamics. Should be in in the interval [0,1]. |
kick | Frequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
set_params_from_pt | Sets the parameters in params from a point. |
energy_func | Computes the energy function at a point specified in params |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
reject_sample | Rejects a generated sample. This is optional and can be set to NULL. |
Definition at line 301 of file dynamics.c.
Error* hybrid_monte_carlo_2_d | ( | uint32_t | iterations, |
uint32_t | leap_iter, | ||
const Vector_d * | delta_t, | ||
double | alpha, | ||
uint32_t | kick, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(const Vector_d *p, void *params) | set_params_from_pt, | ||
Error *(*)(double *energy_out, void *params) | energy_func, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params) | accept_sample, | ||
Error *(*)(const Vector_d *sample, const Vector_d *momenta, void *params) | reject_sample | ||
) |
Double precision hybrid monte carlo.
See Neal '93 for details.
Preserves phase space volume and generates unbiased samples.
iterations | Number of Metropolis-Hastings iterations. Proportional to the number of samples generated, depending on the rejection rate. |
leap_iter | Number of leapfrog iterations between each Metropolis-Hastings iterations. |
delta_t | Time discretization step size. |
alpha | Parameter for stochastic dynamics. Should be in in the interval [0,1]. |
kick | Frequency (in iterations) to kick the particle and reset the momenta. Set to zero if no kicking is needed. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
set_params_from_pt | Sets the parameters in params from a point. |
energy_func | Computes the energy function at a point specified in params |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample. Updates the params with the sample. |
reject_sample | Rejects a generated sample. This is optional and can be set to NULL. |
Definition at line 368 of file dynamics.c.
Error* langevin_1_f | ( | uint32_t | iterations, |
float | delta_t, | ||
void * | params, | ||
void(*)(Vector_f **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(Vector_f **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_f *sample, void *params) | accept_sample | ||
) |
Single precision Langevin dynamics.
Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 598 of file dynamics.c.
Error* langevin_2_f | ( | uint32_t | iterations, |
const Vector_f * | delta_t, | ||
void * | params, | ||
void(*)(Vector_f **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(Vector_f **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_f *sample, void *params) | accept_sample | ||
) |
Single precision Langevin dynamics.
Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 645 of file dynamics.c.
Error* langevin_1_d | ( | uint32_t | iterations, |
double | delta_t, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, void *params) | accept_sample | ||
) |
Double precision Langevin dynamics.
Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 718 of file dynamics.c.
Error* langevin_2_d | ( | uint32_t | iterations, |
const Vector_d * | delta_t, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, void *params) | accept_sample | ||
) |
Double precision Langevin dynamics.
Follows the negative gradient of an energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 765 of file dynamics.c.
Error* langevin_hyperdynamics_1_f | ( | uint32_t | iterations, |
float | delta_t, | ||
float | gamma, | ||
float | eta, | ||
float | h, | ||
float | d, | ||
void * | params, | ||
void(*)(Vector_f **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(const Vector_f *p, void *params) | set_params_from_pt, | ||
Error *(*)(float *energy_out, void *params) | energy_func, | ||
Error *(*)(Vector_f **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_f *sample, void *params, float energy_bias) | accept_sample | ||
) |
Single precision Voter hyperdynamics.
Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
gamma | Step size for gradient descent for each parameter. Very small positive value. |
eta | Difference parameter for derivative numerical approximations. Small positive value. |
h | Bias scaling of the Voter's function (h). Height of the smallest transition area is good starting value. |
d | Distance scale from one minima to another in terms of 2*pi*d. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
set_params_from_pt | Sets the params from a point. |
energy_func | Computes the energy function at a point specified in params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 2711 of file dynamics.c.
Error* langevin_hyperdynamics_2_f | ( | uint32_t | iterations, |
const Vector_f * | delta_t, | ||
float | gamma, | ||
float | eta, | ||
float | h, | ||
float | d, | ||
void * | params, | ||
void(*)(Vector_f **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(const Vector_f *p, void *params) | set_params_from_pt, | ||
Error *(*)(float *energy_out, void *params) | energy_func, | ||
Error *(*)(Vector_f **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_f *sample, void *params, float energy_bias) | accept_sample | ||
) |
Single precision Voter hyperdynamics.
Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
gamma | Step size for gradient descent for each parameter. Very small positive value. |
eta | Difference parameter for derivative numerical approximations. Small positive value. |
h | Bias scaling of the Voter's function (h). Height of the smallest transition area is good starting value. |
d | Distance scale from one minima to another in terms of 2*pi*d. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
set_params_from_pt | Sets the params from a point. |
energy_func | Computes the energy function at a point specified in params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample by. Updates the params with the sample. |
Definition at line 2777 of file dynamics.c.
Error* langevin_hyperdynamics_1_d | ( | uint32_t | iterations, |
double | delta_t, | ||
double | gamma, | ||
double | eta, | ||
double | h, | ||
double | d, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(const Vector_d *p, void *params) | set_params_from_pt, | ||
Error *(*)(double *energy_out, void *params) | energy_func, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, void *params, double energy_bias) | accept_sample | ||
) |
Double precision Voter hyperdynamics.
Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
gamma | Step size for gradient descent for each parameter. Very small positive value. |
eta | Difference parameter for derivative numerical approximations. Small positive value. |
h | Bias scaling of the Voter's function (h). Height of the smallest transition area is good starting value. |
d | Distance scale from one minima to another in terms of 2*pi*d. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
set_params_from_pt | Sets the params from a point. |
energy_func | Computes the energy function at a point specified in params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample. |
Definition at line 2970 of file dynamics.c.
Error* langevin_hyperdynamics_2_d | ( | uint32_t | iterations, |
const Vector_d * | delta_t, | ||
double | gamma, | ||
double | eta, | ||
double | h, | ||
double | d, | ||
void * | params, | ||
void(*)(Vector_d **p_out, const void *params) | get_pt_from_params, | ||
Error *(*)(const Vector_d *p, void *params) | set_params_from_pt, | ||
Error *(*)(double *energy_out, void *params) | energy_func, | ||
Error *(*)(Vector_d **grad_out, void *params) | grad_energy_func, | ||
Error *(*)(const Vector_d *sample, void *params, double energy_bias) | accept_sample | ||
) |
Double precision Voter hyperdynamics.
Follows the negative gradient of a (biased) energy function. Note that this will focus samples in areas of low energy. If you are interested in maxima, have your energy_func and grad_energy_func negate things.
iterations | Number of Langevin dynamcs steps to take; number of samples to generate. |
delta_t | Stochastics dynamics integration step size. |
gamma | Step size for gradient descent for each parameter. Very small positive value. |
eta | Difference parameter for derivative numerical approximations. Small positive value. |
h | Bias scaling of the Voter's function (h). Height of the smallest transition area is good starting value. |
d | Distance scale from one minima to another in terms of 2*pi*d. |
params | Parameter(s) for the callback functions. |
get_pt_from_params | Gets the parameters as a point from params. |
set_params_from_pt | Sets the params from a point. |
energy_func | Computes the energy function at a point specified in params. |
grad_energy_func | Computes the gradient of the energy function at a point specified in params |
accept_sample | Accepts a generated sample. |
Definition at line 3035 of file dynamics.c.