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

Update math.py to include tanh elementwise op #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Henry-Chinner
Copy link

No description provided.

@Henry-Chinner
Copy link
Author

This was my first pull request ever, so hope I did it right :) . I added a tanh elementwise function. It seemed to be missing and intended to be included as there is a tanh_d.

@andersbll
Copy link
Owner

Hey, thank you for the proposal! I have intentionally left out cudarray.nnet.tanh() because NumPy exposes it at the root level. Therefore, you can find it as cudarray.tanh(). The implementation is here.

Best,
Anders

@Henry-Chinner
Copy link
Author

Ah great, Thanks Anders.

While on the subject, are elementwise operations executed on the CPU or GPU. I did some monitoring and it seems like elementwise operations are performed on the CPU.

Henry,

@andersbll
Copy link
Owner

Hey, I have just pushed a commit. In this new version of CUDArray you can check the backend by printing cudarray._backend. If this variable is 'numpy' instead of 'cuda', something is wrong with your libcudarray installation.

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 this pull request may close these issues.

2 participants