A model augmented with parameter perturbations for iterated filtering.
tfp.experimental.sequential.IteratedFilter(
parameter_prior, parameterized_initial_state_prior_fn,
parameterized_transition_fn, parameterized_observation_fn,
parameterized_initial_state_proposal_fn=None, parameterized_proposal_fn=None,
parameter_constraining_bijector=None, name=None
)
Args |
parameter_prior
|
prior tfd.Distribution over parameters (may be a joint
distribution).
|
parameterized_initial_state_prior_fn
|
callable with signature
initial_state_prior = parameterized_initial_state_prior_fn(parameters)
where parameters has the form of a sample from parameter_prior ,
and initial_state_prior is a distribution over the initial state.
|
parameterized_transition_fn
|
callable with signature
next_state_dist = parameterized_transition_fn(
step, state, parameters, **kwargs) .
|
parameterized_observation_fn
|
callable with signature
observation_dist = parameterized_observation_fn(
step, state, parameters, **kwargs) .
|
parameterized_initial_state_proposal_fn
|
optional callable with
signature initial_state_proposal =
parameterized_initial_state_proposal_fn(parameters) where parameters
has the form of a sample from parameter_prior , and
initial_state_proposal is a distribution over the initial state.
|
parameterized_proposal_fn
|
optional callable with signature
next_state_dist = parameterized_transition_fn(
step, state, parameters, **kwargs) .
Default value: None .
|
parameter_constraining_bijector
|
optional tfb.Bijector instance
such that parameter_constraining_bijector.forward(x) returns valid
parameters for any real-valued x of the same structure and shape
as parameters . If None , the default bijector of the provided
parameter_prior will be used.
Default value: None .
|
name
|
str name for ops constructed by this object.
Default value: iterated_filter .
|
Attributes |
batch_ndims
|
|
joint_initial_state_prior
|
Initial state prior for the joint (augmented) model.
|
joint_observation_fn
|
Observation function for the joint (augmented) model.
|
joint_proposal_fn
|
Proposal function for the joint (augmented) model.
|
joint_transition_fn
|
Transition function for the joint (augmented) model.
|
name
|
|
parameter_constraining_bijector
|
Bijector mapping unconstrained real values into the parameter space.
|
parameter_prior
|
Prior distribution on parameters passed in at construction.
|
parameterized_initial_state_prior_fn
|
Prior function that was passed in at construction.
|
parameterized_initial_state_proposal_fn
|
Initial proposal function passed in at construction.
|
Methods
estimate_parameters
View source
estimate_parameters(
observations, num_iterations, num_particles, initial_perturbation_scale,
cooling_schedule, seed=None, name=None, **kwargs
)
Runs multiple iterations of filtering following a cooling schedule.
Args |
observations
|
observed Tensor value(s) on which to condition the
parameter estimate.
|
num_iterations
|
int Tensornumber of filtering iterations to run.
</td>
</tr><tr>
<td> num_particles</td>
<td>
scalar int Tensornumber of particles to use.
</td>
</tr><tr>
<td> initial_perturbation_scale</td>
<td>
scalar float Tensor, or any structure of
float Tensors broadcasting to the same shape as the (unconstrained)
parameters, specifying the scale (standard deviation) of Gaussian
perturbations to each parameter at the first timestep.
</td>
</tr><tr>
<td> cooling_schedule</td>
<td>
callable with signature cooling_factor = cooling_schedule(iteration)for iterationin [0, ..., num_iterations - 1]. The filter is
invoked with perturbations of scale initial_perturbation_scale * cooling_schedule(iteration).
</td>
</tr><tr>
<td> seed</td>
<td>
int Tensorseed for random ops.
</td>
</tr><tr>
<td> name</td>
<td> strname for ops constructed by this method.
</td>
</tr><tr>
<td> **kwargs`
|
additional keyword arguments passed to
tfp.experimental.mcmc.infer_trajectories .
|
Returns |
final_parameter_particles
|
structure of Tensor s matching
self.parameter_prior , each with batch shape
[num_iterations, num_particles] . These are the populations
of particles representing the parameter estimate after each iteration
of filtering.
|
joint_initial_state_proposal
View source
joint_initial_state_proposal(
initial_unconstrained_parameters=None
)
Proposal to initialize the model with given parameter particles.
one_step
View source
one_step(
observations, perturbation_scale, num_particles,
initial_unconstrained_parameters=None, seed=None, name=None, **kwargs
)
Runs one step of filtering to sharpen parameter estimates.
Args |
observations
|
observed Tensor value(s) on which to condition the
parameter estimate.
|
perturbation_scale
|
scalar float Tensor , or any structure of float
Tensor s broadcasting to the same shape as the unconstrained
parameters, specifying the scale (standard deviation) of Gaussian
perturbations to each parameter at each timestep.
|
num_particles
|
scalar int Tensor number of particles to use. Must match
the batch dimension of initial_unconstrained_parameters , if specified.
|
initial_unconstrained_parameters
|
optional structure of Tensor s, of
shape matching
self.joint_initial_state_prior.sample([
num_particles]).unconstrained_parameters ,
used to initialize the filter.
Default value: None .
|
seed
|
int Tensor seed for random ops.
|
name
|
str name for ops constructed by this method.
|
**kwargs
|
additional keyword arguments passed to
tfp.experimental.mcmc.infer_trajectories .
|
Returns |
final_unconstrained_parameters
|
structure of Tensor s matching
initial_unconstrained_parameters , containing samples of
unconstrained parameters at the final timestep, as computed by
self.filter_fn .
|