Skip to content

Added custom inputs and basic cluster analysis #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nairb1234
Copy link

No description provided.

@nairb1234
Copy link
Author

Test from Brian

Copy link
Collaborator

@rdgao rdgao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops my bad

@@ -1,40 +0,0 @@
# Data Download
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did this file get deleted? undo undo!

@@ -64,14 +65,14 @@ def adaptive_exp_net(all_param_dict):
)

### TO DO: also randomly initialize w to either randint(?)*b or randn*(v-v_rest)*a

poisson_input_E = b2.PoissonInput(
''' poisson_input_E = b2.PoissonInput(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened here? This func didn't need to be changed right (or is used at all)?

@@ -64,14 +65,14 @@ def adaptive_exp_net(all_param_dict):
)

### TO DO: also randomly initialize w to either randint(?)*b or randn*(v-v_rest)*a

poisson_input_E = b2.PoissonInput(
''' poisson_input_E = b2.PoissonInput(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened here? This func didn't need to be changed right (or is used at all)?

@@ -64,14 +65,14 @@ def adaptive_exp_net(all_param_dict):
)

### TO DO: also randomly initialize w to either randint(?)*b or randn*(v-v_rest)*a

poisson_input_E = b2.PoissonInput(
''' poisson_input_E = b2.PoissonInput(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened here? This func didn't need to be changed right (or is used at all)? The quotes are typos / accidents?

@@ -64,14 +65,14 @@ def adaptive_exp_net(all_param_dict):
)

### TO DO: also randomly initialize w to either randint(?)*b or randn*(v-v_rest)*a

poisson_input_E = b2.PoissonInput(
''' poisson_input_E = b2.PoissonInput(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened here? This func didn't need to be changed right (or is used at all)? The quotes are typos / accidents?

Copy link
Author

@nairb1234 nairb1234 May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sorry I probably wanted to check if the custom inputs were working and silenced this to confirm, the Poisson input should be kept.

@@ -17,6 +17,7 @@

def _filter_spikes_random(spike_trains, n_to_save):
"""Filter a subset of spike trains randomly for saving."""
np.random.seed(42)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot if we talked about this but should this be reproduceably random, i.e., using the model random_seed?

if n_to_save == len(spike_trains):
# recorded and to-be saved is the same length, go on a per usual
spike_dict[sm.name] = b2_interface._deunitize_spiketimes(spike_trains)
else:
# recorded more than necessary, subselect for saving
spike_dict[sm.name] = b2_interface._deunitize_spiketimes(
_filter_spikes_random(spike_trains, n_to_save)
_filter_spikes_random(spike_trains, n_to_save) # THIS IS WHERE THE NEURONS ARE RANDOMLY DROPPED BEFORE SAVING (AND PLOTTING??)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so it's not being randomly dropped anymore?

@@ -674,3 +676,31 @@ def load_df_posteriors(path_dict):
path_dict["root_path"] + path_dict["params_dict_analysis_updated"]
)
return df_posterior_sims, posterior, params_dict_default

def sort_neurons(membership, sorting_method="cluster_identity"):
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice this should be quite useful

@@ -584,3 +583,126 @@ def plot_corr_pv(pvals, ax, alpha_level=0.05, fmt="w*", ms=0.5):
for j in range(pvals.shape[0]):
if pvals[i, j] < alpha_level:
ax.plot(j, i, fmt, ms=ms, alpha=1)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is not being used anymore because you extracted the sorting function right? Then I think it can be removed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the two notebook files are nice and demonstrate the new capabilities well, but making it more like a demo / pedagogical notebook, with some more descriptions would be good, in the style of the two existing demo notebooks. I think some of the code can also be removed or at least cleaned up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants