Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d5843a9
model_configurator:
Olimaol Jun 19, 2024
167fb0f
model_configurator: cleaned upd code
Olimaol Jun 20, 2024
acd5429
model_configurator:
Olimaol Jun 20, 2024
1247e5f
changed run_script_parallel
Olimaol Jun 24, 2024
0e32ca4
model_configurator: tried to regress mean shift and std scaling in test2
Olimaol Jun 25, 2024
5291e20
model_configurator:
Olimaol Jun 26, 2024
f5828dd
.
Olimaol Jun 26, 2024
594ab37
.
Olimaol Jun 27, 2024
ef0dc17
model_configurator: oreoared opt of mean shift/std scale for hinton
Olimaol Jun 27, 2024
11bd9e6
.
Olimaol Jun 27, 2024
f0b558f
system_functions: create_data_raw_folder
Olimaol Aug 9, 2024
bedb58e
model_configurator: started restructure fit mean shift and std scale
Olimaol Aug 12, 2024
748d052
CompNeuroExp: only set model_state if populations adn/or projections …
Olimaol Aug 13, 2024
5738af4
Merge branch 'olimaol_develop' of https://github.com/Olimaol/CompNeur…
Olimaol Aug 13, 2024
28ea91b
model_configurator: continued restructure opt mean shift, std scale
Olimaol Aug 13, 2024
a4f0401
replaced separate ANNarchy imports with a single silent ANNarchy import
Olimaol Aug 13, 2024
6f9486b
model_configurator: continued restructure mean_shift, std_scale optim…
Olimaol Aug 13, 2024
b3fc217
model_configurator: implemented regression
Olimaol Aug 14, 2024
25102fe
model_configurator: adjusted regression of mean_shift and std_scale
Olimaol Aug 15, 2024
6a9fb69
.
Olimaol Aug 15, 2024
c05a139
.
Olimaol Aug 15, 2024
1ce1b4e
create_data_raw_folder now works with module and dictionary
Olimaol Sep 4, 2024
a26d6d3
Merge branch 'olimaol_develop' of https://github.com/Olimaol/CompNeur…
Olimaol Sep 4, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dist/
*.pkl
*json
*.log
*test2_data*/
37 changes: 37 additions & 0 deletions src/CompNeuroPy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
### ANNarchy
import os
import sys
from contextlib import contextmanager


@contextmanager
def suppress_stdout():
"""
Suppresses the print output of a function

Example:
```python
with suppress_stdout():
print("this will not be printed")
```
"""
with open(os.devnull, "w") as devnull:
old_stdout = sys.stdout
sys.stdout = devnull
try:
yield
finally:
sys.stdout = old_stdout


with suppress_stdout():
import ANNarchy as ann
from ANNarchy.core import ConnectorMethods as ann_ConnectorMethods

if ann.__version__ >= "4.8":
from ANNarchy.intern.NetworkManager import NetworkManager as ann_NetworkManager
else:
from ANNarchy.core import Global as ann_Global

from ANNarchy.core import Random as ann_Random

### functions
from CompNeuroPy.analysis_functions import (
my_raster_plot,
Expand Down
12 changes: 6 additions & 6 deletions src/CompNeuroPy/analysis_functions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from ANNarchy import raster_plot, dt, inter_spike_interval, coefficient_of_variation
from CompNeuroPy import ann
import warnings
from CompNeuroPy import system_functions as sf
from CompNeuroPy import extra_functions as ef
Expand All @@ -27,9 +27,9 @@ def my_raster_plot(spikes: dict):
n (array):
ranks of the neurons
"""
t, n = raster_plot(spikes)
t, n = ann.raster_plot(spikes)
np.zeros(10)
t = np.round(t / dt(), 0).astype(int)
t = np.round(t / ann.dt(), 0).astype(int)
return t, n


Expand Down Expand Up @@ -357,7 +357,7 @@ def _get_pop_rate_old(spikes, duration, dt=1, t_start=0, t_smooth_ms=-1):
duration_init = duration
temp_duration = duration + t_start

t, n = raster_plot(spikes)
t, n = ann.raster_plot(spikes)
if len(t) > 1: # check if there are spikes in population at all
if t_smooth_ms == -1:
ISIs = []
Expand Down Expand Up @@ -1562,7 +1562,7 @@ def _interspike_interval_plot(self, compartment, data):
### set title
plt.title(f"Interspike interval histogram {compartment} ({len(data)})")
### get interspike intervals
interspike_intervals_list = inter_spike_interval(spikes=data)
interspike_intervals_list = ann.inter_spike_interval(spikes=data)
### plot histogram
plt.hist(
interspike_intervals_list,
Expand Down Expand Up @@ -1590,7 +1590,7 @@ def _coefficient_of_variation_plot(self, compartment, data):
### set title
plt.title(f"Coefficient of variation histogram {compartment} ({len(data)})")
### get coefficient of variation
coefficient_of_variation_dict = coefficient_of_variation(
coefficient_of_variation_dict = ann.coefficient_of_variation(
spikes=data,
per_neuron=True,
)
Expand Down
Loading