Skip to content

Commit 63a5273

Browse files
mariomario
authored andcommitted
replace matlab structure syntax with python dictionary
1 parent fb85dfe commit 63a5273

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

code/python/cni_toolbox/HGR.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ def get_parameters(self, n_batch = 10000,
221221

222222
cx = np.floor(pos / self.r_stimulus)
223223
cy = pos % self.r_stimulus
224-
results.mu_x[batch] = cx / self.r_stimulus * max_radius * 2 - max_radius
225-
results.mu_y[batch] = -cy / self.r_stimulus * max_radius * 2 - max_radius
226-
R = np.sqrt(results.mu_x[batch]**2 + results.mu_y[batch]**2)
224+
results['mu_x'][batch] = cx / self.r_stimulus * max_radius * 2 - max_radius
225+
results['mu_y'][batch] = -cy / self.r_stimulus * max_radius * 2 - max_radius
226+
R = np.sqrt(results['mu_x'][batch]**2 + results['mu_y'][batch]**2)
227227
P = np.hstack((m_image, R))
228-
results.sigma[batch] = np.matmul(P, beta)
228+
results['sigma'][batch] = np.matmul(P, beta)
229229

230230
i = int(v / n_mask * 21)
231231
sys.stdout.write('\r')
@@ -248,11 +248,11 @@ def get_parameters(self, n_batch = 10000,
248248

249249
cx = np.floor(pos / self.r_stimulus)
250250
cy = pos % self.r_stimulus
251-
results.mu_x[batch] = cx / self.r_stimulus * max_radius * 2 - max_radius
252-
results.mu_y[batch] = -cy / self.r_stimulus * max_radius * 2 - max_radius
253-
R = np.sqrt(results.mu_x[batch]**2 + results.mu_y[batch]**2)
251+
results['mu_x'][batch] = cx / self.r_stimulus * max_radius * 2 - max_radius
252+
results['mu_y'][batch] = -cy / self.r_stimulus * max_radius * 2 - max_radius
253+
R = np.sqrt(results['mu_x'][batch]**2 + results['mu_y'][batch]**2)
254254
P = np.hstack((m_image, R))
255-
results.sigma[batch] = np.matmul(P, beta)
255+
results['sigma'][batch] = np.matmul(P, beta)
256256

257257
i = int(v / n_mask* 21)
258258
sys.stdout.write('\r')

0 commit comments

Comments
 (0)