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

sigmoid_fast in GRU? #1967

Closed
oysteinsolheim opened this issue May 21, 2022 · 2 comments · Fixed by #1968
Closed

sigmoid_fast in GRU? #1967

oysteinsolheim opened this issue May 21, 2022 · 2 comments · Fixed by #1968

Comments

@oysteinsolheim
Copy link
Contributor

Hi!
Is there any particular reason that sigmoid_fast is not used in the helper function _gru_output in the GRU layer in reccurent.jl? I see it used in the LSTM layer.

function _gru_output(gxs, ghs, bs)
  r = @. σ(gxs[1] + ghs[1] + bs[1])
  z = @. σ(gxs[2] + ghs[2] + bs[2])
  return r, z
end

In my (not so simple) use case i got a 5% speed up in the forward step using sigmoid_fast on cpu compared to the above version.

@ToucheSir
Copy link
Member

If I had to guess, we just missed it. Care to file a PR?

@oysteinsolheim
Copy link
Contributor Author

Sure!

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.

2 participants