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

Make DeepONet and FourierNeuralOperator into structs #16

Closed
KirillZubov opened this issue Jul 23, 2024 · 6 comments
Closed

Make DeepONet and FourierNeuralOperator into structs #16

KirillZubov opened this issue Jul 23, 2024 · 6 comments

Comments

@KirillZubov
Copy link
Member

KirillZubov commented Jul 23, 2024

deeponet = NeuralOperators.DeepONet(
    Chain(
        Dense(1 => 10, Lux.tanh_fast), Dense(10 => 10, Lux.tanh_fast), Dense(10 => 10)),
    Chain(Dense(1 => 10, Lux.tanh_fast), Dense(10 => 10, Lux.tanh_fast),
        Dense(10 => 10, Lux.tanh_fast)))
julia> deeponet.name ==nothing 
true

it guess it should be something like deeponet.name == "DeepONet"

@KirillZubov
Copy link
Member Author

@avik-pal is there another easy way to find out the type of Lux.NeuralOperator? is it DeepONet or FourierNeuralOperator and etc?

@avik-pal
Copy link
Member

No don't dispatch on name, name is used for pretty printing. Use CompactLuxLayer{:DeepONet}.

@KirillZubov
Copy link
Member Author

@avik-pal ok, how identify type of FourierNeuralOperator?

@avik-pal
Copy link
Member

FNO just returns a Chain. We could modify it to return a layer that can be dispatched on.

@avik-pal avik-pal changed the title DeepONet name Make DeepONet and FourierNeuralOperator into structs Jul 24, 2024
@avik-pal
Copy link
Member

@ayushinav can you get this done?

@ayushinav
Copy link
Contributor

We can probably make a CompactLayer for FNOs too and other architectures in future, otherwise the structs would only contain the chain of the operator. Making a struct for different parameters of each operator sort of defeats the purpose of how useful CompactLayers are.
For now, I'm inclined towards creating a struct with only the chain as its parameter.

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

Successfully merging a pull request may close this issue.

3 participants