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

One dimensional universal approximators and tensor product basis #173

Closed
ChrisRackauckas opened this issue Feb 28, 2020 · 2 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed layer

Comments

@ChrisRackauckas
Copy link
Member

We should make it very easy to use lower dimensional universal approximators. For example,

f(x,p) = p[1] + p[2] * sin(x) + p[3] * sin(2x) + ...

for sine basis, etc. Then take each AbstractOneDimensionalBasis and do things like:

TensorProduct(Fourier(10),Chebyshev(10),Polynomial(6))

for a 3-dimensional tensor product of 10 sine terms, 10 Chebyschev polynomials, and z, z^2, z^3, z^4, z^5, z^6, i.e. R^3 -> R function.

Then

f=Stack(TensorProduct(Fourier(10),Chebyshev(10),Polynomial(6),4)

would have f(x,p) be an R^3 -> R^4 funciton. This can be setup like FastChain to automatically cut up the vector.

@ChrisRackauckas ChrisRackauckas added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 28, 2020
@YingboMa
Copy link
Member

Should this be a part of ApproxFun? @dlfivefifty

@dlfivefifty
Copy link

I would say it would be better to use the quasi-array framework I'm designing to replace the core of ApproxFun, see

https://github.com/JuliaApproximation/ContinuumArrays.jl
https://github.com/JuliaApproximation/OrthogonalPolynomialsQuasi.jl

The benefit of this is everything then uses array terminology: bases are treating as quasi-arrays, for example

axes(Chebyshev()) == (Inclusion(-1..1),1:∞)
axes(Fourier()) == (Inclusion(0..2π),-:∞)

Your code above would then become:

A = kron(Fourier()[:,-5:5],Chebyshev()[:,1:10],Polynomial()[:,1:10])
f = vcat(fill(A,4)...)
f[SVector(0.1,0.2,0.5),SVector(1,2,3)] # returns exp(im*0.1)*T_2(0.2)*0.5^3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed layer
Projects
None yet
Development

No branches or pull requests

3 participants