Skip to content

Instantly share code, notes, and snippets.

@RenSys
Last active June 22, 2018 12:09
Show Gist options
  • Save RenSys/a8d8c223aefaebc5656ef25666089aa0 to your computer and use it in GitHub Desktop.
Save RenSys/a8d8c223aefaebc5656ef25666089aa0 to your computer and use it in GitHub Desktop.
Theano -Shared Variables
from theano import shared, function
from theano import tensor as T
# (theano Tutorial)[http://deeplearning.net/software/theano/tutorial/examples.html]
state = shared(0)
inc = T.iscalar('inc')
accumulator = function([inc], state, updates=[(state, state + inc)])
# up to here
# http://deeplearning.net/software/theano/tutorial/examples.html#using-shared-variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment