|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
#include <beta.hpp>
Classes | |
| class | param_type |
Public Types | |
| using | result_type = RealType |
Public Member Functions | |
| beta_distribution (RealType a, RealType b) | |
| beta_distribution (const param_type &p) | |
| result_type | a () const |
| result_type | b () const |
| void | reset () |
| param_type | param () const |
| void | param (const param_type &p) |
| template<typename Generator > | |
| result_type | operator() (Generator &g) |
| template<typename Generator > | |
| result_type | operator() (Generator &g, const param_type &p) |
| result_type | min () const |
| result_type | max () const |
| bool | operator== (const beta_distribution< result_type > &other) const |
| bool | operator!= (const beta_distribution< result_type > &other) const |
Private Types | |
| using | gamma_dist = std::gamma_distribution< RealType > |
Private Member Functions | |
| template<typename Generator > | |
| result_type | generate (Generator &g) |
| template<typename Generator > | |
| result_type | generate (Generator &g, const param_type &p) |
| template<typename Generator > | |
| result_type | generate_johnk (Generator &g, result_type a, result_type b) |
| template<typename Generator > | |
| result_type | generate_gamma (Generator &g, gamma_dist &gamma_a, gamma_dist &gamma_b) |
Private Attributes | |
| param_type | m_params |
| gamma_dist | m_gamma_a |
| gamma_dist | m_gamma_b |
Produces random floating point values drawn from a Beta distribution with parameters a > 0 and b > 0.
See:
https://en.wikipedia.org/wiki/Beta_distribution
for more details.
|
private |
| using lbann::beta_distribution< RealType >::result_type = RealType |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
Generate Beta-distributed values based on Gamma distributions. See: https://en.wikipedia.org/wiki/Beta_distribution#Generating_beta-distributed_random_variates for details.
Definition at line 219 of file beta.hpp.
|
inlineprivate |
Generate Beta-distributed values using Johnk's algorithm. This is a rejection-sampling algorithm that only needs a few uniformly random values.
See:
Johnk, H. D. "Erzeugung von betaverteilten und gammaverteilten Zufallszahlen." Metrika 8, no. 1 (1964).
For an English-language presentation, see:
Atkinson, A. C. and M. C. Pearce. "The computer generation of beta, gamma and normal random variables." Journal of the Royal Statistical Society: Series A (General) 139, no. 4 (1976).
This includes fixes for numerical stability when the parameters are small, see:
https://github.com/numpy/numpy/issues/5851
for discussion there; and a catch for the (extremely rare) case of the RNG giving us U and V both exactly 0.
Note: There should be an umlaut on the "o" in "Johnk", but blame poor unicode support.
Definition at line 186 of file beta.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
|
private |
|
private |