Skip to content

Commit

Permalink
Prevent intensity from being exactly zero
Browse files Browse the repository at this point in the history
If the intensity is zero, then an inf value will occur in the likelihood, so need to bias a small amount .
  • Loading branch information
edeno committed Jul 16, 2018
1 parent b8bf7cf commit 6320671
Show file tree
Hide file tree
Showing 5 changed files with 348 additions and 348 deletions.
342 changes: 171 additions & 171 deletions examples/Simulate_Ripple_Decoding_Data_Clusterless.ipynb

Large diffs are not rendered by default.

348 changes: 174 additions & 174 deletions examples/Simulate_Ripple_Decoding_Data_Sorted_Spikes.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions replay_classification/clusterless.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def poisson_mark_log_likelihood(marks, joint_mark_intensity_functions=None,
[[jmi(signal_marks) for jmi in jmi_by_state]
for signal_marks, jmi_by_state
in zip(marks, joint_mark_intensity_functions)])
joint_mark_intensity += np.spacing(1)
return np.log(joint_mark_intensity) + probability_no_spike


Expand Down
3 changes: 1 addition & 2 deletions replay_classification/sorted_spikes.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ def poisson_log_likelihood(is_spike, conditional_intensity=None,
n_place_bins)
'''
conditional_intensity += np.spacing(1)
probability_no_spike = -conditional_intensity * time_bin_size
is_spike = atleast_kd(is_spike, conditional_intensity.ndim)
conditional_intensity[
np.isclose(conditional_intensity, 0.0)] = np.spacing(1)
return (np.log(conditional_intensity) * is_spike +
probability_no_spike)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='replay_classification',
version='0.4.1',
version='0.4.2',
license='GPL-3.0',
description=('Non-parametric categorization of replay content from'
' multiunit spiking activity'),
Expand Down

0 comments on commit 6320671

Please sign in to comment.