|
Deterministic Gaussian Sampling
|
quadrature-free Gaussian-to-Dirac approximation for an even-dimensional standard normal target More...
#include <gm_to_dirac_even_closed_form.h>
Public Types | |
| using | GSLVectorType = typename gm_to_dirac_approx_standard_normal_distribution_i< T >::GSLVectorType |
| using | GSLMatrixType = typename gm_to_dirac_approx_standard_normal_distribution_i< T >::GSLMatrixType |
Public Types inherited from gm_to_dirac_approx_standard_normal_distribution_i< T > | |
| using | GSLVectorType = typename GSLTemplateTypeAlias< T >::VectorType |
| using | GSLVectorViewType = typename GSLTemplateTypeAlias< T >::VectorViewType |
| using | GSLMatrixType = typename GSLTemplateTypeAlias< T >::MatrixType |
Public Member Functions | |
| bool | approximate (size_t L, size_t N, double bMax, T *x, const T *wX=nullptr, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) |
| approximate a standard normal by L Dirac components | |
| void | modified_van_mises_distance_sq (T *distance, size_t L, size_t N, double bMax, T *x, const T *wX) |
| true mCvM distance, D1 included | |
| void | modified_van_mises_distance_sq_derivative (T *gradient, size_t L, size_t N, double bMax, T *x, const T *wX) |
| gradient of the true mCvM distance with respect to x | |
| bool | approximate (size_t L, size_t N, double bMax, GSLVectorType *x, const GSLVectorType *wX=nullptr, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) |
| void | modified_van_mises_distance_sq (T *distance, size_t L, size_t N, double bMax, GSLVectorType *x, const GSLVectorType *wX) |
| void | modified_van_mises_distance_sq_derivative (GSLVectorType *gradient, size_t L, size_t N, double bMax, GSLVectorType *x, const GSLVectorType *wX) |
| bool | approximate (size_t L, size_t N, double bMax, GSLMatrixType *x, const GSLVectorType *wX=nullptr, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) |
| void | modified_van_mises_distance_sq (T *distance, size_t L, size_t N, double bMax, GSLMatrixType *x, const GSLVectorType *wX) |
| void | modified_van_mises_distance_sq_derivative (GSLMatrixType *gradient, size_t L, size_t N, double bMax, GSLMatrixType *x, const GSLVectorType *wX) |
| bool | approximate_isotropic (size_t L, size_t N, double sigma, double bMax, T *x, const T *wX=nullptr, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) |
| approximate an isotropic Gaussian N(0, sigma^2 * I) | |
| void | modified_van_mises_distance_sq_isotropic (T *distance, size_t L, size_t N, double sigma, double bMax, T *x, const T *wX) |
| true mCvM distance for an isotropic Gaussian N(0, sigma^2 * I) | |
| bool | approximate (size_t L, size_t N, T *x, const T *wX, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) override |
| approximate using raw pointers | |
| void | modified_van_mises_distance_sq (T *distance, size_t L, size_t N, size_t bMax, T *x, const T *wX) override |
| calculate modified van mises distance based on standard normal deviation and x | |
| void | modified_van_mises_distance_sq_derivative (T *gradient, size_t L, size_t N, size_t bMax, T *x, const T *wX) override |
| calculate modified van mises distance based on standard normal deviation and x | |
| bool | approximate (size_t L, size_t N, GSLVectorType *x, const GSLVectorType *wX=nullptr, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) override |
| approximate using gsl vectors | |
| void | modified_van_mises_distance_sq (T *distance, size_t L, size_t N, size_t bMax, GSLVectorType *x, const GSLVectorType *wX) override |
| calculate modified van mises distance based on standard normal deviation and x | |
| void | modified_van_mises_distance_sq_derivative (GSLVectorType *gradient, size_t L, size_t N, size_t bMax, GSLVectorType *x, const GSLVectorType *wX) override |
| calculate modified van mises distance based on standard normal deviation and x | |
| bool | approximate (size_t L, size_t N, GSLMatrixType *x, const GSLVectorType *wX=nullptr, GslminimizerResult *result=nullptr, const ApproximateOptions &options=ApproximateOptions{}) override |
| approximate using gsl vectors | |
| void | modified_van_mises_distance_sq (T *distance, size_t L, size_t N, size_t bMax, GSLMatrixType *x, const GSLVectorType *wX) override |
| calculate modified van mises distance based on standard normal deviation and x | |
| void | modified_van_mises_distance_sq_derivative (GSLMatrixType *gradient, size_t L, size_t N, size_t bMax, GSLMatrixType *x, const GSLVectorType *wX) override |
| calculate modified van mises distance based on standard normal deviation and x | |
| bool | approximate (size_t L, size_t N, double bMax, gsl_vector_float *x, const gsl_vector_float *wX, GslminimizerResult *result, const ApproximateOptions &options) |
| void | modified_van_mises_distance_sq (float *distance, size_t L, size_t N, double bMax, gsl_vector_float *x, const gsl_vector_float *wX) |
| void | modified_van_mises_distance_sq_derivative (gsl_vector_float *gradient, size_t L, size_t N, double bMax, gsl_vector_float *x, const gsl_vector_float *wX) |
| bool | approximate (size_t L, size_t N, double bMax, gsl_vector *x, const gsl_vector *wX, GslminimizerResult *result, const ApproximateOptions &options) |
| void | modified_van_mises_distance_sq (double *distance, size_t L, size_t N, double bMax, gsl_vector *x, const gsl_vector *wX) |
| void | modified_van_mises_distance_sq_derivative (gsl_vector *gradient, size_t L, size_t N, double bMax, gsl_vector *x, const gsl_vector *wX) |
| bool | approximate (size_t L, size_t N, double bMax, gsl_vector_float *x, const gsl_vector_float *wX, GslminimizerResult *result, const ApproximateOptions &options) |
| bool | approximate (size_t L, size_t N, double bMax, gsl_vector *x, const gsl_vector *wX, GslminimizerResult *result, const ApproximateOptions &options) |
| void | modified_van_mises_distance_sq (float *distance, size_t L, size_t N, double bMax, gsl_vector_float *x, const gsl_vector_float *wX) |
| void | modified_van_mises_distance_sq (double *distance, size_t L, size_t N, double bMax, gsl_vector *x, const gsl_vector *wX) |
| void | modified_van_mises_distance_sq_derivative (gsl_vector_float *gradient, size_t L, size_t N, double bMax, gsl_vector_float *x, const gsl_vector_float *wX) |
| void | modified_van_mises_distance_sq_derivative (gsl_vector *gradient, size_t L, size_t N, double bMax, gsl_vector *x, const gsl_vector *wX) |
Data Fields | |
| bool | includeD1InObjective = true |
| carry the sample-independent constant inside the minimizer's objective | |
quadrature-free Gaussian-to-Dirac approximation for an even-dimensional standard normal target
Same objective as gm_to_dirac_short_standard_normal_deviation, but every integral over the kernel-width variable b is evaluated in closed form (see lcd_even_closed_form.h).
One further differences from the quadrature path:
| bool gm_to_dirac_even_closed_form< T >::approximate | ( | size_t | L, |
| size_t | N, | ||
| double | bMax, | ||
| T * | x, | ||
| const T * | wX = nullptr, |
||
| GslminimizerResult * | result = nullptr, |
||
| const ApproximateOptions & | options = ApproximateOptions{} |
||
| ) |
approximate a standard normal by L Dirac components
| L | number of Dirac components |
| N | dimension, must be even and >= 2 |
| bMax | upper bound of the b-integral, must be > 0 |
| x | initial guess and output locations (L * N) |
| wX | weights, nullptr for uniform |
| result | minimizer result |
| options | minimizer options; options.bMax is ignored here |
|
overridevirtual |
approximate using gsl vectors
| L | number of data points for apprioximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| wX | weights for the x data points |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
|
overridevirtual |
approximate using gsl vectors
| L | number of data points for apprioximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| wX | weights for the x data points |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
|
overridevirtual |
approximate using raw pointers
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
| bool gm_to_dirac_even_closed_form< T >::approximate_isotropic | ( | size_t | L, |
| size_t | N, | ||
| double | sigma, | ||
| double | bMax, | ||
| T * | x, | ||
| const T * | wX = nullptr, |
||
| GslminimizerResult * | result = nullptr, |
||
| const ApproximateOptions & | options = ApproximateOptions{} |
||
| ) |
approximate an isotropic Gaussian N(0, sigma^2 * I)
Solves the standard-normal problem at bMax / sigma and scales the result by sigma. This is why the new API takes a double bMax: bMax / sigma is generally not an integer.
| L | number of Dirac components |
| N | dimension, must be even and >= 2 |
| sigma | standard deviation, must be > 0 |
| bMax | upper bound of the b-integral, must be > 0 |
| x | initial guess and output locations (L * N) |
| wX | weights, nullptr for uniform |
| result | minimizer result |
| options | minimizer options; options.bMax is ignored here |
| void gm_to_dirac_even_closed_form< T >::modified_van_mises_distance_sq | ( | T * | distance, |
| size_t | L, | ||
| size_t | N, | ||
| double | bMax, | ||
| T * | x, | ||
| const T * | wX | ||
| ) |
true mCvM distance, D1 included
| distance | output distance |
| L | number of Dirac components |
| N | dimension, must be even and >= 2 |
| bMax | upper bound of the b-integral, must be > 0 |
| x | sample locations (L * N) |
| wX | weights, nullptr for uniform |
|
overridevirtual |
calculate modified van mises distance based on standard normal deviation and x
| distance | pointer to distance value to be calculated |
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
|
overridevirtual |
calculate modified van mises distance based on standard normal deviation and x
| distance | pointer to distance value to be calculated |
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
|
overridevirtual |
calculate modified van mises distance based on standard normal deviation and x
| distance | pointer to distance value to be calculated |
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
|
overridevirtual |
calculate modified van mises distance based on standard normal deviation and x
| gradient | pointer to gradient to be calculated |
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
|
overridevirtual |
calculate modified van mises distance based on standard normal deviation and x
| gradient | pointer to gradient to be calculated |
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
| void gm_to_dirac_even_closed_form< T >::modified_van_mises_distance_sq_derivative | ( | T * | gradient, |
| size_t | L, | ||
| size_t | N, | ||
| double | bMax, | ||
| T * | x, | ||
| const T * | wX | ||
| ) |
gradient of the true mCvM distance with respect to x
| gradient | output gradient (L * N) |
| L | number of Dirac components |
| N | dimension, must be even and >= 2 |
| bMax | upper bound of the b-integral, must be > 0 |
| x | sample locations (L * N) |
| wX | weights, nullptr for uniform |
|
overridevirtual |
calculate modified van mises distance based on standard normal deviation and x
| gradient | pointer to gradient to be calculated |
| L | number of data points for approximation |
| N | dimension of the data |
| bMax | bMax |
| x | first guess for the approximation and return value |
| result | minimizer result |
| options | options for minimizer |
Implements gm_to_dirac_approx_standard_normal_distribution_i< T >.
| void gm_to_dirac_even_closed_form< T >::modified_van_mises_distance_sq_isotropic | ( | T * | distance, |
| size_t | L, | ||
| size_t | N, | ||
| double | sigma, | ||
| double | bMax, | ||
| T * | x, | ||
| const T * | wX | ||
| ) |
true mCvM distance for an isotropic Gaussian N(0, sigma^2 * I)
D(sigma, bMax) = sigma^2 * D(1, bMax / sigma).
| distance | output distance |
| L | number of Dirac components |
| N | dimension, must be even and >= 2 |
| sigma | standard deviation, must be > 0 |
| bMax | upper bound of the b-integral, must be > 0 |
| x | sample locations (L * N) |
| wX | weights, nullptr for uniform |
carry the sample-independent constant inside the minimizer's objective
The constant does not depend on x, so omitting it leaves the gradient and the minimum unchanged and saves one scalar evaluation per objective call. With it, the objective IS the distance.