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

How to maintain a list of Parameters in Model #37

Open
ksudoh opened this issue Feb 20, 2018 · 0 comments
Open

How to maintain a list of Parameters in Model #37

ksudoh opened this issue Feb 20, 2018 · 0 comments

Comments

@ksudoh
Copy link
Contributor

ksudoh commented Feb 20, 2018

When I implemented stacked LSTMs, there was a need to maintain layer-wise parameter matrices in one Parameter, such as

  • Wx[0]: Parameter Wx for layer 1,
  • Wx[1]: Parameter Wx for layer 2, ... .

Currently there are no good ways to do so,
then my current implementation defines large concatenated matrices and extracts corresponding parts by F.slice(); this is not efficient, hard to read, and suffers from a constraint of the parameter sizes (the size of rows or columns has to be the same).

  • Wx = F.concat([ Wx[0], Wx[1], ... , Wx[n-1] ], 1)
  • Wx[i] = F.slice(Wx, 1, d*i, (d+1)*i)

If we can maintain such kind of Parameter lists or sets, implementation of stacked models becomes much easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant