Created
September 26, 2020 20:41
-
-
Save SaraM92/862877ebe074adf4259153fdad39713e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import needed libraries | |
import theano | |
from theano import tensor | |
#Define sigmoid function | |
def sigmoid(x): | |
return 1 / (1 + tensor.exp(-x)) | |
#Creating a symbolic variable | |
a = tensor.dmatrix('a') | |
#Get sigmoid of a | |
sig_a = sigmoid(a) | |
#Apply functiom | |
log = theano.function([a], sig) | |
#Call log function for specific values | |
print(log([[0, 1], [-1, -2]])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment