Skip to content

Commit

Permalink
Normalize stimulus using its norm after weighing
Browse files Browse the repository at this point in the history
  • Loading branch information
ycanerol committed Jun 13, 2017
1 parent 6cc094b commit 58c49de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lnp_checkerflicker.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,12 @@ def stim_weighted(sta, max_i, stimulus):
weights = -weights
stim_small = stimulus[max_i[0]-f_size-1:max_i[0]+f_size,
max_i[1]-f_size-1:max_i[1]+f_size, :]
stim_weighed = np.array([])
stim_weighted = np.array([])
for i in range(stim_small.shape[2]):
stim_weighed = np.append(stim_weighed, np.sum(stim_small[:, :, i] *
weights))
return stim_weighed
stim_weighted = np.append(stim_weighted, np.sum(stim_small[:, :, i] *
weights))
stim_weighted = stim_weighted/np.sqrt(np.sum(stim_weighted**2))
return stim_weighted


def nlt_recovery(spikes, stimulus, sta, bin_nr, dt):
Expand Down

0 comments on commit 58c49de

Please sign in to comment.