Releases: neurolib-dev/neurolib
Hotfix and getIndividualFromHistory()
A small update with two minor changes. Thanks everyone for reporting issues! 🛠
- Hotfix: include
pypet_logging.ini
in pypi package - Evolution: new method
getIndividualFromHistory()
Bugfixes, examples and preparations for something big
Bugfixes:
example-0.5
: Demonstrating the use of external stimuli on brain networksexample-1.3
: 2D bifurcation diagrams usingpypet
bold
: BOLD numerical overflow bug fixedevolution
: dfEvolution and dfPop fixexploration
: fix seed for random initial conditions- various minor bugfixes
Hotfix: RNG seed
🔥 Hotfix for RNG seed in exploration: Seed None
is now converted to "None"
for for pypet
compatibility only when saving the model.params
to the trajectory.
🛠 Fix: dfEvolution
drops duplicate entries from the evolution.history
.
Happy computing 👩🏿🔬!
Stimulus construction
aln: record adaptation currents
Exploration and Evolution: improvements
Release time 💪🏾!
Version 0.5.1 of neurolib
is out and we have some juicy improvements for exploration and evolution!
Evolution:
- NSGA-2 algorithm implemented (Deb et al. 2002)
- Preselect complete algorithms (using
algorithm="adaptive"
or"nsga2"
) - Implement custom operators for all evolutionary operations
- Keep track of the evolution history using
evolution.history
- Genealogy
evolution.tree
available fromevolution.buildEvolutionTree()
that isnetworkx
compatible [1] - Continue working:
saveEvolution()
andloadEvolution()
can load an evolution from another session [2] - Overview dataframe
evolution.dfPop
now has all fitness values as well - Get scores using
getScores()
- Plot evolution progress with
evolutionaryUtils.plotProgress()
Exploration:
- Use
loadResults(all=True)
to load all simulated results from disk to memory (available as.results
) or useall=False
to load runs individually from hdf. Both options populatedfResults
. loadResults()
has memory cap to avoid filling up RAMloadDfResults()
creates the parameter table from a previous simulationexplorationUtils.plotExplorationResults()
for plotting 2D slices of the explored results with some advanced functions like alpha maps and contours for predefined regions.
devUtils
- A module that we are using for development and research with some nice features. Please do not rely on this file since there might be breaking changes in the future.
plot_outputs()
like a true numerical simlordmodel_fit()
to compute the model's FC and FCD fit to the dataset, could be usefull for everyonegetPowerSpectrum()
does what is saysgetMeanPowerSpectrum()
same- a very neat
rolling_window()
from anumpy
PR that never got accepted
Other:
- Data loading:
Dataset
can load different SC matrix normalizations:"max", "waytotal", "nvoxel"
- Can precompute FCD matrices to avoid having to do it later (
fcd=True
)
neurolib/utils/atlas.py
added with aal2 region names (thanks @jajcayn) and coordinates of centers of regions (from scans of @caglorithm's brain 🤯)ParameterSpace
has.lowerBound
and.upperBound
.pypet
finally doesn't create a billion log files anymore due to a custom log config
[1] Plotting the genealogy tree:
import matplotlib.pyplot as plt
import networkx as nx
from networkx.drawing.nx_pydot import graphviz_layout
G = nx.DiGraph(evolution.tree)
G = G.reverse() # Make the graph top-down
pos = graphviz_layout(G, prog='dot')
plt.figure(figsize=(8, 8))
nx.draw(G, pos, node_size=50, alpha=0.5, node_color=list(evolution.id_score.values()), with_labels=False)
plt.show()
[2] Loading precomputed evolution
evaluateSimulation = lambda x: x # the funciton can be ommited, that's why we define a lambda here
pars = ParameterSpace(['a', 'b'], # should be same as previously saved evolution
[[0.0, 4.0], [0.0, 5.0]])
evolution = Evolution(evaluateSimulation, pars, weightList = [1.0])
evolution = evolution.loadEvolution("data/evolution-results-2020-05-15-00H-24M-48S.dill")
Thalamic neural mass model and Exploration tools
We're happy to introduce a few new features in this release!
- 🧠 New model: Thalamus model
ThalamicMassModel
(thanks to @jajcayn)- Model by Costa et al. 2016, PLOS Computational Biology
- ⚒ New tools for parameter exploration:
explorationUtils.py
akaeu
- Postprocessing of exploration results using
eu.processExplorationResults()
- Find parameters of explored simulations using
eu.findCloseResults()
- Plot exploration results via
eu.plotExplorationResults()
(see example image below)
- Postprocessing of exploration results using
- 🧪 Custom transformation of the inputs to the
BOLDModel
.- This is particularly handy for phenomenological models (such as
FHNModel
,HopfModel
andWCModel
) which do not produce firing rate outputs with units inHz
.
- This is particularly handy for phenomenological models (such as
- 🔬Improvements
- Models can now generate random initial conditions using
model.randomICs()
model.params['bold'] = True
forces BOLD simulationBoxSearch
class:search.run()
passes arguments tomodel.run()
- BOLD output time array renamed to
t_BOLD
- Models can now generate random initial conditions using
🖼 Example image generated by eu.plotExplorationResults()
: Exploration results of a brain network of FHNModel
nodes using the hcp
dataset.
Wilson-Cowan model and consistent chunkwise durations
Changes:
- New model: Wilson-Cowan neural mass model implemented (thanks to @ChristophMetzner )
- Simulations now start their output at
t=dt
(as opposed tot=0
before). Everything before is now considered an initial condition. - Fix: Running a simulation chunkwise (using
model.run(chunkwise=True)
) and normally (usingmodel.run()
) produces output of the same length - Fix:
aln
network coupling, which apparent when simulating chunkwise withmodel.run(chunkwise=True, chunksize=1)
- Fix: Correct use of seed for RNG
- Fix: Matrices are not normalized to max-1 anymore before each run.
- Fix: Kolmogorov distance of FCD matrices and timeseries
Automatic chunkwise integration, model simplification, better datasets and evolution
We are happy to announce a new release of neurolib
which brings us a lot closer to reaching one of our main milestones, the implementation of a multi-model Circuit
🤯🐝🎉.
Changes:
- This update brings Python 3.6-3.8 support (backwards compatibility)
- A new feature of all models called
autochunk
can integrate a model chunkwise by itself which makes model implementation a lot easier! If a model wants to use this feature, it has to specify a list of itsstate_vars
(state variables), the name of the analogousinit_vars
(initial values),output_vars
for automatic storing of the model results and optionally a `default_output. autochunk
can also integrate every model by a singledt
. This is a necessary preparation for the upcomingCircuit
class.- With this update, every model can now also produce a BOLD signal. If the model is not a firing rate model (that produces outputs with a physcal unit of
Hz
, namely spikes per second), it can specify an attributenormalize_bold_input
and the output will be normalized to a given range (given bynormalize_bold_input_max
) and a BOLD signal will be computed. Seeneurolib.models.hopf
for an example. - The DTI datasets can now be loaded with several normalization methods, if the appropriate information is provided in the dataset. The provided DTI matrices are produced using
FSL
, from which we included thewaytotal.txt
(number of valid fibers found) and thenvoxel.txt
file (number of voxels of the source region). - The evolutionary algorithm now allows you to register your own mating and mutation operators, making use of the simple interface that is provided by the
deap
package. - Got rid of 230 lines of code while the functionality increased. Yay!
Whole-brain optimization and signal processing
This brand new release adds some fancy features and has a ton of fixes.
Main changes include:
- Whole-brain optimization using the evolutionary pipeline. See example notebook!
- Evolution supports custom mating and selection operators.
- A new
Signal
class with lots of options to process model outputs. See example notebook! - Use new
ParameterSpace
in evolution and exploration.
Happy modeling!