Samplers
RandomFeatures.Samplers.Sampler — Type
struct Sampler{RNG<:Random.AbstractRNG}Wraps the parameter distributions and random number generator used to draw random feature parameters.
parameter_distribution::EnsembleKalmanProcesses.ParameterDistributions.ParameterDistribution: A probability distribution, possibly with constraintsrng::Random.AbstractRNG: A random number generator state
Constructors
FeatureSampler(parameter_distribution, bias_distribution; rng)— explicitParameterDistributionbias, ornothingfor no bias term.FeatureSampler(parameter_distribution, output_dim; uniform_shift_bounds, rng)— uniform bias overoutput_dimdimensions; bounds default to[0, 2π].
RandomFeatures.Samplers.FeatureSampler — Function
FeatureSampler(
parameter_distribution::EnsembleKalmanProcesses.ParameterDistributions.ParameterDistribution,
bias_distribution::Union{Nothing, EnsembleKalmanProcesses.ParameterDistributions.ParameterDistribution};
rng
) -> Sampler{Random.TaskLocalRNG}
Construct a Sampler from a parameter_distribution and an optional bias_distribution.
When bias_distribution is nothing, no bias term is added to the feature inner product. When a ParameterDistribution is supplied, it is combined with parameter_distribution into a single joint distribution before wrapping in the Sampler.
Pass a ParameterDistribution with name "xi" for the feature weights.
RandomFeatures.Samplers.get_parameter_distribution — Function
get_parameter_distribution(
s::Sampler
) -> EnsembleKalmanProcesses.ParameterDistributions.ParameterDistribution
gets the parameter_distribution field
RandomFeatures.Samplers.get_rng — Function
get_rng(s::Sampler) -> Random.AbstractRNG
gets the rng field
StatsBase.sample — Method
sample(
rng::Random.AbstractRNG,
s::Sampler,
n_draws::Int64
) -> EnsembleKalmanProcesses.ParameterDistributions.ParameterDistribution
samples the distribution within s, n_draws times using a random number generator rng. Can be called without rng (defaults to s.rng) or n_draws (defaults to 1)