Skip to content
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

Investigate A plus A minus combination #11

Open
wants to merge 13 commits into
base: thesis_results
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ data/
cerebellum_NODS.hdf5
cerebellum_NODS_smaller.hdf5
p.p

#PLOT
.html
13 changes: 7 additions & 6 deletions compare_w-wo_NO/grc_sdf_raster.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import sys
import os

Expand All @@ -24,18 +25,18 @@
without_NO_color = "#000000"
cell = "granule_spikes"

results_path = f"/media/amtra/Samsung_T5/EBCC_4Hz/"
results_path = f"/home/nomodel/code/NODS/results/grid_search/grid_NO/test/"
spk = get_spike_activity(cell_name=cell, path=results_path)
evs_cell = spk[:, 0]
sdf_mean_cell = []
sdf_change_alltrials = []

"""
results_path_NO = f"/media/amtra/Samsung_T5/EBCC_NO_4Hz/"
spk_NO = get_spike_activity(cell_name=cell, path=results_path_NO)
evs_cell_NO = spk[:, 0]
sdf_mean_cell_NO = []
sdf_change_alltrials_NO = []

"""
# %% PLOT SDF
palette = list(reversed(sns.color_palette("viridis", n_trials).as_hex()))
sm = plt.cm.ScalarMappable(cmap="viridis_r", norm=plt.Normalize(vmin=0, vmax=n_trials))
Expand All @@ -48,12 +49,12 @@
stop = CS_start_first + CS_burst_dur + trial * between_start
sdf_cell = sdf(start=start, stop=stop, spk=spk, step=step)
sdf_mean_cell.append(sdf_mean(sdf_cell))
sdf_cell_NO = sdf(start=start, stop=stop, spk=spk_NO, step=step)
sdf_mean_cell_NO.append(sdf_mean(sdf_cell_NO))
#sdf_cell_NO = sdf(start=start, stop=stop, spk=spk_NO, step=step)
#sdf_mean_cell_NO.append(sdf_mean(sdf_cell_NO))

for trial in range(n_trials):
axs_sdf[0].plot(sdf_mean_cell[trial], palette[trial])
axs_sdf[1].plot(sdf_mean_cell_NO[trial], palette[trial])
#axs_sdf[1].plot(sdf_mean_cell_NO[trial], palette[trial])

axs_sdf[0].axvline(CS_start_first, label="CS start", linewidth=3, c=CS_color)
axs_sdf[0].axvline(
Expand Down
23 changes: 12 additions & 11 deletions compare_w-wo_NO/sdf_boxplots_048.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import scipy.stats as st

noise_rates = [0, 4, 8]
rooth_path = "/media/amtra/Samsung_T5/results/"
with open("network_configuration.json", "r") as json_file:
rooth_path = "/home/nomodel/code/NODS/results/"
with open("/home/nomodel/code/NODS/network_configuration.json", "r") as json_file:
net_config = json.load(json_file)

CS_burst_dur = net_config["devices"]["CS"]["parameters"]["burst_dur"]
Expand All @@ -29,20 +29,20 @@

cell = "pc_spikes"

fig, axs = plt.subplots(1,3,figsize=(8,4))
fig, axs = plt.subplots(3,1,figsize=(4,8))
colors = [without_NO_color, with_NO_color, without_NO_color, with_NO_color]
medianprops = dict(linewidth=1.5, color='white')
positions = [1,2,4,5]

for i, noise_rate in enumerate(noise_rates):

results_path = rooth_path + f"complete_EBCC/EBCC_{noise_rate}Hz/"
results_path = rooth_path + f"grid_search/{noise_rate}Hz/min4_plus8/6/"
spk = get_spike_activity(cell_name=cell, path=results_path)
sdf_mean_over_trials = []
sdf_baseline = np.zeros((n_trials))
sdf_cr = np.zeros((n_trials))

results_path_NO = rooth_path + f"complete_EBCC/EBCC_NO_{noise_rate}Hz/"
results_path_NO = rooth_path + f"grid_search/grid_NO/{noise_rate}Hz/0/"
spk_NO = get_spike_activity(cell_name=cell, path=results_path_NO)
sdf_mean_over_trials_NO = []
sdf_baseline_NO = np.zeros((n_trials))
Expand All @@ -56,13 +56,13 @@
sdf_cells = sdf(start=start, stop=stop, spk=spk, step=5)
sdf_mean_trial = sdf_mean(sdf_cells)
sdf_mean_over_trials.append(sdf_mean_trial)
sdf_baseline[trial] = np.mean(sdf_mean_trial[100:150])
sdf_baseline[trial] = np.mean(sdf_mean_trial[150:200])
sdf_cr[trial] = np.mean(sdf_mean_trial[250:300])

sdf_cells_NO = sdf(start=start, stop=stop, spk=spk_NO, step=5)
sdf_mean_trial_NO = sdf_mean(sdf_cells_NO)
sdf_mean_over_trials_NO.append(sdf_mean_trial_NO)
sdf_baseline_NO[trial] = np.mean(sdf_mean_trial_NO[100:150])
sdf_baseline_NO[trial] = np.mean(sdf_mean_trial_NO[150:200])
sdf_cr_NO[trial] = np.mean(sdf_mean_trial_NO[250:300])

sdf_change_baseline = sdf_baseline[1:] - sdf_baseline[1]
Expand All @@ -86,10 +86,11 @@
patch.set_facecolor(color)
axs[i].axvline(3,linewidth=1, color='black')
axs[i].set_xticks([])
axs[i].set_ylim(-30,0)
axs[i].set_ylim(-25,5)
axs[i].set_title(f'CS: 40Hz, BkG noise: {noise_rate}Hz')

plt.tight_layout()
plt.show()
fig.savefig(f"sdf_boxplots_048.png")
fig.savefig(f"sdf_boxplots_048.svg")
#plt.show()
fig.savefig(f"sdf_boxplots_048_grid.png")
#fig.savefig(f"sdf_boxplots_048.svg")
# %%
Binary file added compare_w-wo_NO/sdf_boxplots_048_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 12 additions & 11 deletions demos/demo_single_pc_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,17 +438,18 @@
ID_cell = nest.GetStatus(spikedetector_GR, "events")[0]["senders"]
active_sources = ID_cell[processed:]
processed += len(active_sources)
sim.evaluate_diffusion(active_sources, t)
list_dict = []
for i in range(len(pfs)):
list_dict.append(
{
"meta_l": float(
sig(x=sim.NO_in_ev_points[t, i], A=1, B=NO_threshold)
)
}
)
nest.SetStatus(pfs, list_dict)
if t % 2:
sim.evaluate_diffusion(active_sources, t)
list_dict = []
for i in range(len(pfs)):
list_dict.append(
{
"meta_l": float(
sig(x=sim.NO_in_ev_points[t, i], A=1, B=NO_threshold)
)
}
)
nest.SetStatus(pfs, list_dict)
t = time.time() - t0
print("time {}".format(t))

Expand Down
303,463 changes: 510 additions & 302,953 deletions demos/demo_single_source.ipynb

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions grid_search_Aplus_Aminus/grid_search.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys
import os
import nest
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from simulateEBCC import SimulateEBCC
import numpy as np
import gc

n_sim = 10

noise_rate = 4.0

i = 4
j = 1

for k in range(0,n_sim):
os.system(f'python /home/nomodel/code/NODS/grid_search_Aplus_Aminus/simulation_grid.py {noise_rate} {k} {i} {j}')
Loading