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

Create numerical integrator objects following optimizers and ODE solvers strategy #1750

Open
luisfpereira opened this issue Dec 8, 2022 · 0 comments
Labels
enhancement information geometry Information geometry related content

Comments

@luisfpereira
Copy link
Collaborator

FisherRaoMetric requires the numerical integration of a function. For now, scipy.integrate.quad_vec is used.

Following some design choices made in #1552 (meanwhile this have been developed and a new PR will be opened soon - check it out if already available), we would like to create numerical integrator objects. An initial API is something like this:

class QuadVecIntegrator:
  def __init__(self, **numerical_parameters):
    # init code

  def integrate(self, func_to_integrate):
    # e.g. call quad_vec

This design allows:

  • avoid hard coding the numerical integration
  • tweaking numerical parameters more easily (e.g. currently we only allow control of support)
  • easily add new numerical integrators (including non scipy based)
  • handle vectorization (making it transparent for the end users of these objects)
  • handle array data types conversions: when going to scipy, we can pass any array support by our backends, but we receive back np.array. The end user expects a gs.array (i.e. an array object of the backend being used)

It is important to pass numerical parameters at instantiation level, so later the use of the integrator within the class simplifies to self.numerical_integrator.solver(func_to_integrate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement information geometry Information geometry related content
Projects
Development

No branches or pull requests

1 participant