@@ -211,14 +211,19 @@ def get_parameters(self, n_batch = 10000,
211
211
beta = regress (S , P )
212
212
213
213
for v in np .arange (0 , n_mask - n_batch , n_batch ):
214
+ i = int (v / n_mask * 21 )
215
+ sys .stdout .write ('\r ' )
216
+ sys .stdout .write ("[%-20s] %d%%"
217
+ % ('=' * i , 5 * i ))
218
+
214
219
batch = idx [v : v + n_batch ]
215
220
im = np .matmul (self .gamma , self .theta [:, batch ])
216
221
pos = np .argmax (im , axis = 0 )
217
222
mx = np .max (im , axis = 0 )
218
223
mn = np .min (im , axis = 0 )
219
224
val_range = mx - mn
220
225
im = ((im - mn ) / val_range )** alpha
221
- m_image = np .mean (im , axis = 0 ). transpose ()
226
+ m_image = np .mean (im , axis = 0 )
222
227
223
228
cx = np .floor (pos / self .r_stimulus )
224
229
cy = pos % self .r_stimulus
@@ -228,17 +233,17 @@ def get_parameters(self, n_batch = 10000,
228
233
P = np .hstack ((m_image .reshape (- 1 ,1 ), R .reshape (- 1 ,1 )))
229
234
results ['sigma' ][batch ] = np .matmul (P , beta )
230
235
231
- i = int (v / n_mask * 21 )
232
- sys .stdout .write ('\r ' )
233
- sys .stdout .write ("[%-20s] %d%%"
234
- % ('=' * i , 5 * i ))
235
-
236
236
exist = 'v' in locals ()
237
237
if exist == False :
238
238
batch = idx
239
239
else :
240
240
batch = idx [v :]
241
241
242
+ i = 20
243
+ sys .stdout .write ('\r ' )
244
+ sys .stdout .write ("[%-20s] %d%%"
245
+ % ('=' * i , 5 * i ))
246
+
242
247
im = np .matmul (self .gamma , self .theta [:, batch ])
243
248
pos = np .argmax (im , axis = 0 )
244
249
mx = np .max (im , axis = 0 )
@@ -255,11 +260,6 @@ def get_parameters(self, n_batch = 10000,
255
260
P = np .hstack ((m_image .reshape (- 1 ,1 ), R .reshape (- 1 ,1 )))
256
261
results ['sigma' ][batch ] = np .matmul (P , beta )
257
262
258
- i = int (v / n_mask * 21 )
259
- sys .stdout .write ('\r ' )
260
- sys .stdout .write ("[%-20s] %d%%"
261
- % ('=' * i , 5 * i ))
262
-
263
263
return results
264
264
265
265
def get_timecourses (self , stimulus ):
@@ -392,7 +392,7 @@ def __create_gamma__(self):
392
392
r = np .arange (self .r_stimulus )
393
393
[x_coordinates , y_coordinates ] = np .meshgrid (r , r )
394
394
x_coordinates = x_coordinates .flatten ()
395
- y_coordinates = - y_coordinates .flatten ()
395
+ y_coordinates = y_coordinates .flatten ()
396
396
sigma = self .fwhm / (2 * np .sqrt (2 * np .log (2 )))
397
397
self .gamma = np .zeros ((self .n_pixels , self .n_features ))
398
398
pix_id = np .linspace (0 , self .n_pixels , self .n_features * self .n_gaussians )
0 commit comments