Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign of Sigma-Point Moment Transforms #21

Open
jacobnzw opened this issue Apr 4, 2019 · 0 comments
Open

Redesign of Sigma-Point Moment Transforms #21

jacobnzw opened this issue Apr 4, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@jacobnzw
Copy link
Owner

jacobnzw commented Apr 4, 2019

Current design of SigmaPointTransform, makes it quite uncomfortable to implement a continuous-time variants of the sigma-point transforms, which require the function evaluation process to be replaced with the solution of the ODE.

That is, instead of "pushing" points through the nonlinearity, like so

# push sigma-points through non-linearity
fx = np.apply_along_axis(f, 0, x, fcn_pars)

one has to "flow" the points through nonlinearity for a given period of time (t0, t1) using and ODE solver, like so

t0, t1 = tf_pars['t0'], tf_pars['t1']
dim_out = f(0, mean).shape[0]
num_points = self.unit_sp.shape[1]
fx = np.empty((dim_out, num_points))
for i in range(num_points):
    # TODO: how to ensure function signature f(t, x)?
    fx[:, i] = solve_ivp(f, (t0, t1), x[:, i], t_eval=(t1, ), method='RK45', rtol=1e-5).y.squeeze()

That is to say, each sigma-point is used as initial condition in an initial value problem (IVP).

When inheriting from SigmaPointTransform, several difficulties follow:

  • apply() method is largely the same, only the function evaluation is replaced
  • there is no way to determine the output dimensionality of the function f, other than the obtuse way. Which is to feed in a dummy input and read off the dimensionality from .shape.
  • no way to guarantee that the solve_ivp receives function signature with proper argument order (i.e. time t as first arg and y as second arg).

Conclusion
SigmaPointTransform would benefit from rewriting, where the nonlinearity evaluation process is separated out into a dedicated function (very much akin, if not the same, to what is in the BQTransform. This solves the first point and makes it easier to reuse the SigmaPointTransform machinery for potential inclusion of the continuous-time variants.

The last two points, however, still remain an issue. One could just pass in the TransitionModel, which carries with it all the nonlinearity parameters (including the output dimensionality).

@jacobnzw jacobnzw added the enhancement New feature or request label Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant