leaspy.samplers.factory¶
Attributes¶
Functions¶
|
Factory for Samplers. |
Module Contents¶
- SamplerFactoryInput¶
- INDIVIDUAL_SAMPLERS¶
- POPULATION_SAMPLERS¶
- sampler_factory(sampler, variable_type, **kwargs)[source]¶
Factory for Samplers.
- Parameters:
- sampler
AbstractSamplerorstr If an instance of a subclass of
AbstractSampler, returns the instance. If a string, returns a new instance of the appropriate class (with optional parameters kwargs).- variable_type
VariableType The type of random variable that the sampler is supposed to sample.
- **kwargs
Optional parameters for initializing the requested Sampler (not used if input is a subclass of
AbstractSampler).
- sampler
- Returns:
AbstractSamplerThe desired sampler.
- Raises:
LeaspyAlgoInputError:If the sampler provided is not supported.
- Parameters:
sampler (SamplerFactoryInput)
- Return type: