Mercurial > pylearn
comparison misc_theano.py @ 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 | |
children |
comparison
equal
deleted
inserted
replaced
326:fe57b96f33d4 | 327:2480024bf401 |
---|---|
1 | |
2 import theano | |
3 | |
4 class Print(theano.Op): | |
5 def __init__(self,message=""): | |
6 self.message=message | |
7 self.view_map={0:[0]} | |
8 | |
9 def make_node(self,xin): | |
10 xout = xin.type.make_result() | |
11 return theano.Apply(op = self, inputs = [xin], outputs=[xout]) | |
12 | |
13 def perform(self,node,inputs,output_storage): | |
14 xin, = inputs | |
15 xout, = output_storage | |
16 xout[0] = xin | |
17 print self.message,xin | |
18 | |
19 def grad(self,input,output_gradients): | |
20 return output_gradients |