Skip to content

Instantly share code, notes, and snippets.

@RenSys
Last active June 22, 2018 12:09
Show Gist options
  • Save RenSys/fe366553685666ddc4099c384e1714a6 to your computer and use it in GitHub Desktop.
Save RenSys/fe366553685666ddc4099c384e1714a6 to your computer and use it in GitHub Desktop.
Theano - Multiple Outputs
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, y = T.dmatrices('x', 'y')
diff_output = x - y
abs_diff_output = abs(diff_output)
diff_squared_output = diff_output**2
# symbolic function
f = function([x, y],
[diff_output, abs_diff_output, diff_squared_output])
print f([[1, 1], [1, 1]],
[[0, 1], [2, 3]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment