Mercurial > pylearn
changeset 327:2480024bf401
added file that was missing in commit 9e96fe8b955c
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Mon, 16 Jun 2008 12:57:32 -0400 |
parents | fe57b96f33d4 |
children | 09140ba68e17 9ce791fb2cbf |
files | misc_theano.py |
diffstat | 1 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc_theano.py Mon Jun 16 12:57:32 2008 -0400 @@ -0,0 +1,20 @@ + +import theano + +class Print(theano.Op): + def __init__(self,message=""): + self.message=message + self.view_map={0:[0]} + + def make_node(self,xin): + xout = xin.type.make_result() + return theano.Apply(op = self, inputs = [xin], outputs=[xout]) + + def perform(self,node,inputs,output_storage): + xin, = inputs + xout, = output_storage + xout[0] = xin + print self.message,xin + + def grad(self,input,output_gradients): + return output_gradients