Last active
June 22, 2018 12:08
-
-
Save RenSys/0ef2639a96a67359bfdfb04a66c56b26 to your computer and use it in GitHub Desktop.
Theano - Matrices Sigmoidal Transfer
This file contains hidden or 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
from theano import function | |
from theano import tensor as T | |
# (theano Tutorial)[http://deeplearning.net/software/theano/tutorial/examples.html] | |
# create a symbolic matrix | |
x = T.dmatrix('x') | |
# Method 1 | |
# symbolic function | |
out = 1 / (1 + T.exp(-x)) | |
f = function([x], out) | |
print f([[0, 1], [-1, -2]]) | |
# Method 1 | |
s2 = (1 + T.tanh(x / 2)) / 2 | |
logistic2 = function([x], s2) | |
print logistic2([[0, 1], [-1, -2]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment