aai-institute / aai-institute/continuiti

FunctionSet should support more functionality to easily sample parameterised functions

未關閉
#132 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
36
分支
2
PR 合併指標
30 天內沒有已合併 PR

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。