Mercurial > pylearn
view misc_theano.py @ 329:9ce791fb2cbf
little hack in MiniBatchToSingleExampleIterator, there was a problem which I think was not a bug, we were receiving [array(3)] and everything was crashing. Hack is kinda slow
author | Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca> |
---|---|
date | Mon, 16 Jun 2008 16:03:16 -0400 |
parents | 2480024bf401 |
children |
line wrap: on
line source
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