Mercurial > pylearn
comparison misc.py @ 233:9e96fe8b955c
moved the function from misc.py that have dependency on theano in misc_theano.py
author | Frederic Bastien <bastienf@iro.umontreal.ca> |
---|---|
date | Tue, 27 May 2008 15:59:02 -0400 |
parents | d7250ee86f72 |
children | 430c9e92cd23 |
comparison
equal
deleted
inserted
replaced
231:38beb81f4e8b | 233:9e96fe8b955c |
---|---|
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 | |
21 | |
22 | 1 |
23 def unique_elements_list_intersection(list1,list2): | 2 def unique_elements_list_intersection(list1,list2): |
24 """ | 3 """ |
25 Return the unique elements that are in both list1 and list2 | 4 Return the unique elements that are in both list1 and list2 |
26 (repeated elements in listi will not be duplicated in the result). | 5 (repeated elements in listi will not be duplicated in the result). |