-
Notifications
You must be signed in to change notification settings - Fork 8
Samplers Docs
Generates a randomly sampled value with specified mean and std based on a Beta distribution.
Parameters:
- alpha - (float) alpha of beta distribution.
- beta - (float) beta of beta distribution.
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.BetaVariate(alpha=1,beta=1,dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Samples a value from a given list according to the provided sampler.
Parameters:
- items - (list) itemsm to be sampled.
- sampler - (Sampler) Sampler used to select an item based on its index.
Return type: n/a
Example:
TODO.
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Base class for all samplers.
Note: This class should not be directly instanciated.
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value with lambda based on an exponential distribution.
Parameters:
- lam - (float) lambda of exponential distribution (one divided by desired mean).
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.ExpoVariate(lam=1, dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value with specified mean and std based on a Gaussian distribution.
Parameters:
- mean - (float) mean of Gaussian. Default: 0.0
- std - (float) standard deviation of Gaussian. Default: 1.0
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.Gaussian(mean=0.0, std=1.0, dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value with specified mean and std based on a Log normal distribution.
Parameters:
- mean - (float) mean of Lognormal. Default: 0.0
- std - (float) standard deviation of Lognormal. Default: 1.0
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.LognormVariate(mean=0.0, std=1.0, dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value with specified mean and std based on a Gaussian distribution.
Parameters:
- mean - (float) mean of Gaussian. Default: 0.0
- std - (float) standard deviation of Gaussian. Default: 1.0
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.Gaussian(mean=0.0, std=1.0, dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value with alpha based on the Pareto distribution.
Parameters:
- alpha - (float) alpha of Pareto distribution (shape parameter).
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.ParetoVariate(alpha=1,dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Base class for all samplers.
Note: This class should not be directly instanciated.
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Given a sampler, clips the distribution between low and high. If None, not truncated.
Parameters:
- sampler - (Sampler) Sampler to be truncated.
- low - (float) minimum value to be sampled. Default: None
- high - (float) maximum value to be sampled. Default: None
Return type: n/a
Example:
sampler = Gaussian(0.0, 0.1)
truncated = Truncated(sampler, -0.1, 0.1)
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value from low to high with equal probability.
Parameters:
- low - (float) minimum value.
- high - (float) maximum value.
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.Uniform(low=-1.0, high=1.0, dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Generates a randomly sampled value with specified mean and std based on a Weibull distribution.
Parameters:
- alpha - (float) alpha of Weibull distribution (scale parameter).
- beta - (float) beta of Weibull distribution (shape parameter).
- dtype - (string) data type. Default: float
Return type: n/a
Example:
randopt.WeibullVariate(alpha=1,beta=1,dtype='float')
def get_state(self)
def sample(self)
def seed(self, seed_val)
def set_state(self, state)
Support the development of randopt, donate to its maintainer.