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

FunctionSet should support more functionality to easily sample parameterised functions #132

Open
2 tasks
samuelburbulla opened this issue Apr 19, 2024 · 0 comments

Comments

@samuelburbulla
Copy link
Collaborator

Currently, we have sth. like

num_functions = 100
degree = 3

space = FunctionSet(lambda a: lambda x: 
     sum(a[i] * x**i for i in range(degree + 1))
 )
coeffs = torch.randn(degree + 1, num_functions)
poly = space(coeffs)                                                 
u = torch.stack([p(x) for p in poly])

In DeepXDE, the same code is:

space = dde.data.PowerSeries(N=degree + 1)
coeffs = space.random(num_functions)
u = space.eval_batch(coeffs, x)

We should introduce the following functionality:

  • poly = space.random(num_functions) which returns an object that contains the list of functions, but can also be evaluated as follows
  • u = poly(x) which returns the same as the eval_batch in DeepXDE

Maybe it makes sense to rename FunctionSet to FunctionSpace then (as in DeepXDE) that holds the mathematical description of the parametric function space, and use the name FunctionSet for the object that holds the list of functions already evaluated at a set of coefficients.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant