Skip to content

Any equivalency to torch.nn.Parameter? #776

Answered by avik-pal
liuyxpp asked this question in Q&A
Discussion options

You must be logged in to vote

Pytorch needs nn.Parameter since it needs to differentiate "tracked" and non-"tracked" arrays. If you want a strict equivalence, Tracker.TrackedArray does the same thing.

Regarding how to do it in Lux, you would want to create a custom layer and define initialparameters https://lux.csail.mit.edu/dev/manual/interface#layer-interface which returns a pos_emb and other such things. Then using Zygote you can train them.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by avik-pal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #464 on July 16, 2024 03:27.