probly.representation.sampling.sampler¶
Model sampling and sample representer implementation.
Functions
|
Get the predictor to be used for sampling. |
|
Sample multiple predictions from the predictor. |
Classes
|
A sampler that creates representations from ensemble predictions. |
|
A representation predictor that creates representations from finite samples. |
- class probly.representation.sampling.sampler.EnsembleSampler(predictor, sample_factory=<lazy_dispatch.singledispatch.lazydispatch object>, sample_axis=1)[source]¶
Bases:
Representer[In,KwIn,Iterable],GenericA sampler that creates representations from ensemble predictions.
- Parameters:
predictor (Predictor[In, KwIn, Iterable[Out]])
sample_factory (SampleFactory[Out, S])
sample_axis (int)
- sample(*args, **kwargs)[source]¶
Sample from the ensemble predictor for a given input.
- Parameters:
args (In)
kwargs (Unpack[KwIn])
- Return type:
S
- sample_factory: SampleFactory[Out, S]¶
- class probly.representation.sampling.sampler.Sampler(predictor, num_samples, sampling_strategy='sequential', sample_factory=<lazy_dispatch.singledispatch.lazydispatch object>, sample_axis=1)[source]¶
Bases:
Representer,GenericA representation predictor that creates representations from finite samples.
- Parameters:
predictor (Predictor[In, KwIn, Out])
num_samples (int)
sampling_strategy (SamplingStrategy)
sample_factory (SampleFactory[Out, S])
sample_axis (int)
- predict(*args, **kwargs)[source]¶
Sample from the predictor for a given input.
- Parameters:
args (In)
kwargs (Unpack[KwIn])
- Return type:
S
- sample_factory: SampleFactory[Out, S]¶
- sampling_strategy: SamplingStrategy¶