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

Numpy's exp() is already vectorized, remove redundant vectorize() call. #27

Closed
wants to merge 1 commit into from

Conversation

nico
Copy link

@nico nico commented Jul 27, 2015

No intended behavior change. The vectorize() documentation points out
that vectorize() is not fast, and indeed after this change the time to
train one epoch is reduced from ~37.6s to ~10.5s on my laptop -- a 72%
reduction.

I haven't read more than Chapter 1 yet (in fact, I haven't completed Chapter 1),
so maybe something like this can be done in other places too.

No intended behavior change.  The vectorize() documentation points out
that vectorize() is not fast, and indeed after this change the time to
train one epoch is reduced from ~37.6s to ~10.5s on my laptop -- a 72%
reduction.
@nico
Copy link
Author

nico commented Jul 27, 2015

…looks like this is a dupe of #20.

@mnielsen
Copy link
Owner

Hi Nico,

Thanks for pointing this out.

It is, indeed, a dupe. I've been so busy with other things (including finishing chapter 6 of the book) I haven't had time to go back to this. With the final chapter done, I should get to this soon. It's more complex than it looks, since I also need to update some parts of chapter 1 and 3 of the book, and that requires considerable care. In the meantime I'll close this issue, & keep #20 open.

@mnielsen mnielsen closed this Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants