cudarray icon indicating copy to clipboard operation
cudarray copied to clipboard

Update math.py to include tanh elementwise op

Open Henry-Chinner opened this issue 9 years ago • 4 comments

Henry-Chinner avatar Apr 30 '15 21:04 Henry-Chinner

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.

Henry-Chinner avatar Apr 30 '15 21:04 Henry-Chinner

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

andersbll avatar May 01 '15 05:05 andersbll

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,

Henry-Chinner avatar May 01 '15 10:05 Henry-Chinner

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.

andersbll avatar May 01 '15 14:05 andersbll