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

Support dictionary of parameters #114

Closed
freddycct opened this issue Oct 23, 2022 · 3 comments · Fixed by #122
Closed

Support dictionary of parameters #114

freddycct opened this issue Oct 23, 2022 · 3 comments · Fixed by #122

Comments

@freddycct
Copy link

Describe the potential feature

Optimisers.setup(Optimisers.Adam(), Dict(1 => rand(Float32, 5), 2=>rand(Float32, 5))) currently returns empty tuple ()

Motivation

Would help more complicated neural architectures.

Possible Implementation

No response

@ToucheSir
Copy link
Member

We'd have to decide how/if to support Dicts in Functors first. Can you open an issue to this effect there?

@mcabbott
Copy link
Member

Can you explain more about why or where Dict is a good idea, instead of say a NamedTuple? Is its mutability important? Are the keys things you invent, or is this something more like an IdDict?

@CarloLucibello
Copy link
Member

CarloLucibello commented Nov 25, 2022

I have a use case in
CarloLucibello/GraphNeuralNetworks.jl#146
where the keys are tuples of string, using named tuple instead would be awkward.
There could be some exotic situations where the dict's values are trained, although most of the time they contain static features. In any case though they have to be moved to gpus, so functor support is necessary.

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.

4 participants