Advertisement
Guest User

Untitled

a guest
May 26th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. #include <torch/torch.h>
  2. #include <ATen/Context.h>
  3. #include <iostream>
  4.  
  5. torch::Tensor ActivationFunction(const torch::Tensor &x)
  6. {
  7. // Sigmoid function.
  8. auto retVal = 1/(1+torch::exp(-x));
  9. return retVal;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement