comparison transformations/thick.py @ 17:c91d9f70206d

Changed a call to numpy without having imported it as numpy
author Xavier Glorot <glorotxa@iro.umontreal.ca>
date Thu, 28 Jan 2010 14:14:53 -0500
parents ebf61603489b
children db10ee2a07fb
comparison
equal deleted inserted replaced
16:368f1907ad5a 17:c91d9f70206d
79 (image,size=self.__structuring_elements__[self.nb].shape,structure=self.__structuring_elements__[self.nb]) 79 (image,size=self.__structuring_elements__[self.nb].shape,structure=self.__structuring_elements__[self.nb])
80 80
81 #------renormalizing 81 #------renormalizing
82 maxit = N.max(trans) 82 maxit = N.max(trans)
83 minit = N.min(trans) 83 minit = N.min(trans)
84 trans= numpy.asarray((trans - (minit+mini)) / (maxit - (minit+mini)) * maxi,dtype=image.dtype) 84 trans= N.asarray((trans - (minit+mini)) / (maxit - (minit+mini)) * maxi,dtype=image.dtype)
85 #-------- 85 #--------
86 return trans 86 return trans
87 else: 87 else:
88 return image 88 return image
89 89
111 #test on NIST (you need pylearn and access to NIST to do that) 111 #test on NIST (you need pylearn and access to NIST to do that)
112 112
113 if __name__ == '__main__': 113 if __name__ == '__main__':
114 114
115 from pylearn.io import filetensor as ft 115 from pylearn.io import filetensor as ft
116 import copy, numpy 116 import copy
117 import pygame 117 import pygame
118 import time 118 import time
119 datapath = '/data/lisa/data/nist/by_class/' 119 datapath = '/data/lisa/data/nist/by_class/'
120 f = open(datapath+'digits/digits_train_data.ft') 120 f = open(datapath+'digits/digits_train_data.ft')
121 d = ft.read(f) 121 d = ft.read(f)