# HG changeset patch # User Frederic Bastien # Date 1213635452 14400 # Node ID 2480024bf401aa87f8563c3c4b07e95d81da5c72 # Parent fe57b96f33d46162645ffdc8e82ed8f788ae4d14 added file that was missing in commit 9e96fe8b955c diff -r fe57b96f33d4 -r 2480024bf401 misc_theano.py --- /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