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

Neuronunit reduced cells #348

Open
wants to merge 132 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
e2af7e2
adding in appropriate notebooks, removed call to pebble pool in neuro…
russelljjarvis Jan 30, 2021
1a6d38c
third example
russelljjarvis Jan 30, 2021
a54de02
adding in single file
russelljjarvis Jan 30, 2021
cc57e0b
reverted algorithms file to the original
russelljjarvis Jan 30, 2021
acd1fb7
reintroduce constructor BPO_deap_opt() argument/ neuronunit=boolean f…
russelljjarvis Jan 30, 2021
c46e5b2
Update README.md
russelljjarvis Jan 31, 2021
3a5e6e2
Update README.md
russelljjarvis Jan 31, 2021
e9253f8
update build instructions pertaining to git to see if using different…
russelljjarvis Jan 31, 2021
5b06b00
Merge branch 'neuronunit_reduced_cells' of https://github.com/russell…
russelljjarvis Jan 31, 2021
938c5c2
Updated config.yml
russelljjarvis Jan 31, 2021
c1de908
converted spaces to tabs
russelljjarvis Jan 31, 2021
d2a75f3
converted spaces to tabs
russelljjarvis Jan 31, 2021
ab4de1f
converted spaces to tabs
russelljjarvis Jan 31, 2021
109a1c4
shorter build+tests
russelljjarvis Jan 31, 2021
7b66fdc
more ci fixing
russelljjarvis Jan 31, 2021
6fad627
perhaps ci will work with different test dependency
russelljjarvis Jan 31, 2021
0f60ea2
added in necessary test
russelljjarvis Jan 31, 2021
d765305
changed setup.py to try to coax tox to run
russelljjarvis Jan 31, 2021
a5e028b
abolished DataTC useful methods persist because of inheritance
russelljjarvis Feb 4, 2021
947666e
change dependencies to run on tox
russelljjarvis Feb 5, 2021
5517669
change dependencies to run on tox
russelljjarvis Feb 5, 2021
7a3f98f
process dependency links
russelljjarvis Feb 5, 2021
27546ab
install requires
russelljjarvis Feb 5, 2021
5f32589
install requires
russelljjarvis Feb 5, 2021
f17f674
install requires
russelljjarvis Feb 5, 2021
2bf11d0
install requires
russelljjarvis Feb 5, 2021
3b89f1b
ci dependency change
russelljjarvis Feb 5, 2021
68bafb6
ci setup dependency change
russelljjarvis Feb 5, 2021
ada84c9
merge
russelljjarvis Feb 6, 2021
c46a5b0
factored out dtc and replaced with models
russelljjarvis Feb 13, 2021
58bd45f
update requirements
russelljjarvis Feb 14, 2021
f979f8d
update CI
russelljjarvis Feb 14, 2021
af4e848
update
russelljjarvis Feb 14, 2021
dbd56ce
update ci
russelljjarvis Feb 14, 2021
ee32666
update CI
russelljjarvis Feb 14, 2021
f9050f7
update
russelljjarvis Feb 14, 2021
4eb3fd3
try to get tox CI working
russelljjarvis Feb 14, 2021
7bac473
update for pull request
russelljjarvis Feb 18, 2021
94e7f90
Fix py2 testing error due to PR #998 in nrn.
Feb 22, 2021
5c0be1a
Merge pull request #349 from AurelienJaquier/master
wvangeit Feb 23, 2021
c2661a0
Add feature computation functions to CellEvaluator, ObjectivesCalcula…
Feb 23, 2021
ceda365
Merge branch 'master' into feature_values
wvangeit Feb 23, 2021
cc732a1
Updated documentation to add the README on RTD.
alex4200 Feb 23, 2021
42dd6bb
Add tests
Feb 23, 2021
4b05e8f
Merge branch 'feature_values' of https://github.com/BlueBrain/BluePyO…
Feb 23, 2021
0b17fda
Merge pull request #350 from BlueBrain/feature_values
wvangeit Feb 24, 2021
3ac2257
Fixed the bagde table.
alex4200 Feb 24, 2021
eb62c27
Merge branch 'master' into alexdoc
wvangeit Feb 24, 2021
4f25199
Merge pull request #351 from alex4200/alexdoc
wvangeit Feb 24, 2021
a076a2f
Added config files for RTD
alex4200 Feb 24, 2021
f0ea22a
Merge branch 'alexdoc' of github.com:alex4200/BluePyOpt into alexdoc
alex4200 Feb 24, 2021
57206ce
Merge branch 'master' into alexdoc
wvangeit Feb 24, 2021
5c8267d
Merge pull request #352 from alex4200/alexdoc
wvangeit Feb 24, 2021
fd29f6c
Commenting out the license text.
alex4200 Feb 24, 2021
ae14666
Merge branch 'alexdoc' of github.com:alex4200/BluePyOpt into alexdoc
alex4200 Feb 24, 2021
3821813
Fixing image in README: Provide proper path depending where the READM…
alex4200 Feb 24, 2021
c9428ad
Merge pull request #353 from alex4200/alexdoc
wvangeit Feb 24, 2021
3aa210c
Fix path in readthedocs yaml
wvangeit Feb 24, 2021
ce4af5c
Fixing image location in README
wvangeit Feb 24, 2021
45b922a
update testing
russelljjarvis Mar 8, 2021
c490139
update
russelljjarvis Mar 10, 2021
22a7d49
update
russelljjarvis Mar 10, 2021
30ae737
update
russelljjarvis Mar 10, 2021
d5755fb
merge
russelljjarvis Mar 10, 2021
fd48264
merged with origin master @bbp.bpo, checked nose test compatibility, …
russelljjarvis Mar 10, 2021
15e28e0
moved dependencies into extras_require
russelljjarvis Mar 10, 2021
e7c3526
update for CI unittesting passing
russelljjarvis Mar 10, 2021
af20008
local CI verification
russelljjarvis Mar 10, 2021
fe7f1e3
update
russelljjarvis Mar 10, 2021
0dc016b
might work
russelljjarvis Mar 10, 2021
98a2ac7
changed test file names
russelljjarvis Mar 24, 2021
087ff46
update file names
russelljjarvis Mar 24, 2021
799e39a
before merge master/origin
russelljjarvis Mar 24, 2021
a35930b
update tox
russelljjarvis Mar 24, 2021
0230b38
update for PR
russelljjarvis Mar 24, 2021
97f3ddb
add missing s into https of extra requirement
russelljjarvis Mar 25, 2021
4515427
update
russelljjarvis Mar 25, 2021
d7ba56e
update
russelljjarvis Mar 25, 2021
1c6941f
neuronunit opt is pip installable, make numba models pip installable
russelljjarvis Mar 25, 2021
d80aa5f
edited CI
russelljjarvis Mar 25, 2021
f88dc6b
update
russelljjarvis Mar 25, 2021
9d8a8e8
update
russelljjarvis Mar 25, 2021
074d948
ci test
russelljjarvis Mar 25, 2021
2d2f964
update
russelljjarvis Mar 25, 2021
7f95c04
update CI
russelljjarvis Mar 25, 2021
bd88a63
update CI
russelljjarvis Mar 26, 2021
50cd426
CI update
russelljjarvis Mar 26, 2021
5b221a6
CI update
russelljjarvis Mar 26, 2021
b6528ed
CI update
russelljjarvis Mar 26, 2021
1acec2f
CI update
russelljjarvis Mar 26, 2021
358f7c2
update
russelljjarvis Mar 26, 2021
140efa2
turn off allensdk logging
russelljjarvis Mar 26, 2021
a406b2c
update CI
russelljjarvis Mar 26, 2021
4736968
update
russelljjarvis Mar 26, 2021
9f8f253
update CI
russelljjarvis Mar 26, 2021
1643059
update CI
russelljjarvis Mar 26, 2021
1141b08
update CI
russelljjarvis Mar 26, 2021
161a5f4
update CI
russelljjarvis Mar 26, 2021
6154405
update
russelljjarvis Mar 26, 2021
35e0325
update
russelljjarvis Mar 26, 2021
7f5d164
update
russelljjarvis Mar 26, 2021
f9fa9ef
update
russelljjarvis Mar 26, 2021
9d782a4
update
russelljjarvis Mar 26, 2021
05f8df9
update
russelljjarvis Mar 26, 2021
ead29d2
update
russelljjarvis Mar 26, 2021
8e787c4
update
russelljjarvis Mar 26, 2021
581e8ed
update ci
russelljjarvis Mar 26, 2021
7413e02
update
russelljjarvis Mar 26, 2021
aa88f5e
blah
russelljjarvis Mar 26, 2021
8552245
blah
russelljjarvis Mar 26, 2021
db3dd29
update
russelljjarvis Mar 27, 2021
1e620dc
tox might work now
russelljjarvis Mar 27, 2021
6bdae3a
update
russelljjarvis Mar 27, 2021
afaca14
update
russelljjarvis Mar 27, 2021
8318b23
update
russelljjarvis Mar 27, 2021
ba5fc85
update CI
russelljjarvis Mar 27, 2021
79dcba0
update CI
russelljjarvis Mar 27, 2021
a300854
try remote machine
russelljjarvis Mar 27, 2021
80a0c8a
update CI
russelljjarvis Mar 27, 2021
ca03190
update CI
russelljjarvis Mar 27, 2021
b9f5658
update
russelljjarvis Mar 27, 2021
1a73bfc
update
russelljjarvis Mar 27, 2021
28c9165
update
russelljjarvis Mar 28, 2021
3613105
update
russelljjarvis Mar 28, 2021
6cac975
Update main.yml
russelljjarvis Mar 29, 2021
915ba1b
wqMerge branch 'neuronunit_reduced_cells' of https://github.com/russe…
russelljjarvis Apr 1, 2021
e1dbace
modified some files with black so that they would pass tox style check
russelljjarvis Apr 1, 2021
8c3a805
update for remote
russelljjarvis Apr 1, 2021
4f0ea68
update
russelljjarvis Apr 1, 2021
7345ee3
update
russelljjarvis Apr 5, 2021
73d85c1
update
russelljjarvis Apr 5, 2021
b2cc789
fixed tab/space error in bpo
russelljjarvis Apr 13, 2021
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
59 changes: 59 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
defaults: &defaults
Copy link
Contributor

Choose a reason for hiding this comment

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

We can leave this file here for now while you're testing your PR. But in the end everything will need to run on Github Actions (using tox).

Copy link
Author

@russelljjarvis russelljjarvis Mar 10, 2021

Choose a reason for hiding this comment

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

Yes, that would be awesome. I will write a clear message somewhere here on the PR, when all the items are finished, but I wont leave it hanging. I still might need 2-3 weeks.

There is a big parallel effort to PR into neuronunit proper. I am also trying to make a streamlit application with a heroku/AWS deployment, that you should be able to log into and actively validate this approach without a big install on your end. Not sure if I will ever get there. But the PRs at least will work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, thanks.

working_directory: ~/markovmodel/PyEMMA
docker:
- image: continuumio/miniconda3

inst_conda_bld: &inst_conda_bld
- run: conda config --add channels conda-forge
- run: conda config --set always_yes true
- run: conda config --set quiet true
- run: conda install conda-build

version: 2

jobs:
build:
<<: *defaults
parallelism: 1
steps:
- checkout
- run: git fetch --unshallow || true
- run: apt-get install -y cpp gcc
- run: apt-get install -y libx11-6 python-dev git build-essential
- run: apt-get install -y autoconf automake gcc g++ make gfortran
- run: apt-get install -y python-tables
- run: apt-get install -y libhdf5-serial-dev

- run: conda config --add channels conda-forge
- run: conda config --set always_yes true
- run: conda config --set quiet true
- run: conda install conda-build
- run: conda install scipy;
- run: conda install numpy;
- run: conda install numba;
- run: conda install dask;
- run: pip install tables
- run: pip install pip --upgrade; pip install -r requirements.txt;
- run: pip install -e .
- run: git clone -b neuronunit https://github.com/russelljjarvis/jit_hub.git
- run: cd jit_hub; pip install -e .; cd ..;
- run: git clone -b optimization https://github.com/russelljjarvis/neuronunit
- run: cd neuronunit; pip install -e .; cd ..;
- run: git clone https://github.com/russelljjarvis/eFEL
- run: cd eFEL; pip install -e .; cd ..;
- run: pip install cython
- run: pip install streamlit;
- run: pip install seaborn;
- run: pip install sklearn
- run: pip install allensdk==0.16.3
- run: pip install frozendict
- run: pip install nose
- run: rm -rf /opt/conda/lib/python3.8/site-packages/sciunit
- run: git clone -b dev https://github.com/russelljjarvis/sciunit.git
- run: cd sciunit; pip install -e .; cd ..;
- run: cd bluepyopt/tests; nosetests test_evaluators.py
- run: cd bluepyopt/tests; nosetests scores_unit_test.py
- run: cd bluepyopt/tests; python rheobase_model_test.py

# causes time out
#- run: cd bluepyopt/tests; python izhi_opt.py
16 changes: 16 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

sphinx:
configuration: docs/source/conf.py
fail_on_warning: true

python:
install:
- method: pip
path: .
- requirements: requirements_docs.txt
273 changes: 273 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
<<<<<<< HEAD:README.rst
|banner|

BluePyOpt
=========

.. raw:: html

<table>
<tr>
<td>Latest Release</td>
<td>
<a href="https://pypi.org/project/bluepyopt/">
<img src="https://img.shields.io/pypi/v/bluepyopt.svg" alt="latest release" />
</a>
</td>
</tr>
<tr>
<td>Documentation</td>
<td>
<a href="https://bluepyopt.readthedocs.io/">
<img src="https://readthedocs.org/projects/bluepyopt/badge/?version=latest" alt="latest documentation" />
</a>
</td>
</tr>
<tr>
<td>License</td>
<td>
<a href="https://github.com/BlueBrain/bluepyopt/blob/master/LICENSE.txt">
<img src="https://img.shields.io/pypi/l/bluepyopt.svg" alt="license" />
</a>
</td>
</tr>
<tr>
<td>Build Status</td>
<td>
<a href="https://github.com/BlueBrain/BluePyOpt/actions">
<img src="https://github.com/BlueBrain/BluePyOpt/workflows/Build/badge.svg?branch=master" alt="Actions build status" />
</a>
</td>
</tr>
<tr>
<td>Coverage</td>
<td>
<a href="https://codecov.io/gh/BlueBrain/bluepyopt">
<img src="https://codecov.io/github/BlueBrain/BluePyOpt/coverage.svg?branch=master" alt="coverage" />
</a>
</td>
</tr>
<tr>
<td>Gitter</td>
<td>
<a href="https://gitter.im/bluebrain/bluepyopt">
<img src="https://badges.gitter.im/Join%20Chat.svg"
</a>
</td>
</tr>
</table>



=======
<img src="docs/source/logo/BluePyOptBanner.png"/>

-----------------
# BluePyOpt: Blue Brain Python Optimisation Library

<table>
<tr>
<td>Latest Release</td>
<td>
<a href="https://pypi.org/project/bluepyopt/">
<img src="https://img.shields.io/pypi/v/bluepyopt.svg" alt="latest release" />
</a>
</td>
</tr>
<tr>
<td>Documentation</td>
<td>
<a href="https://bluepyopt.readthedocs.io/">
<img src="https://readthedocs.org/projects/bluepyopt/badge/?version=latest" alt="latest documentation" />
</a>
</td>
</tr>
<tr>
<td>License</td>
<td>
<a href="https://github.com/BlueBrain/bluepyopt/blob/master/LICENSE.txt">
<img src="https://img.shields.io/pypi/l/bluepyopt.svg" alt="license" />
</a>
</td>
</tr>
<tr>
<td>Build Status</td>
<td>
<a href="https://github.com/BlueBrain/BluePyOpt/actions">
<img src="https://github.com/BlueBrain/BluePyOpt/workflows/Build/badge.svg?branch=master" alt="Actions build status" />
</a>
</td>
</tr>
<tr>
<td>Coverage</td>
<td>
<a href="https://codecov.io/gh/BlueBrain/bluepyopt">
<img src="https://codecov.io/github/BlueBrain/BluePyOpt/coverage.svg?branch=master" alt="coverage" />
</a>
</td>
</tr>
<tr>
<td>Gitter</td>
<td>
<a href="https://gitter.im/bluebrain/bluepyopt">
<img src="https://badges.gitter.im/Join%20Chat.svg"
</a>
</td>
</tr>
</table>
>>>>>>> neuronunit_reduced_cells:README.md
Introduction
============

The Blue Brain Python Optimisation Library (BluePyOpt) is an extensible
framework for data-driven model parameter optimisation that wraps and
standardises several existing open-source tools.

It simplifies the task of creating and sharing these optimisations,
and the associated techniques and knowledge.
This is achieved by abstracting the optimisation and evaluation tasks
into various reusable and flexible discrete elements according to established
best-practices.

Further, BluePyOpt provides methods for setting up both small- and large-scale
optimisations on a variety of platforms,
ranging from laptops to Linux clusters and cloud-based compute infrastructures.

Citation
========

When you use the BluePyOpt software or method for your research, we ask you to cite the following publication (**this includes poster presentations**):

`Van Geit W, Gevaert M, Chindemi G, Rössert C, Courcol J, Muller EB, Schürmann F, Segev I and Markram H (2016). BluePyOpt: Leveraging open source software and cloud infrastructure to optimise model parameters in neuroscience. Front. Neuroinform. 10:17. doi: 10.3389/fninf.2016.00017 <http://journal.frontiersin.org/article/10.3389/fninf.2016.00017>`_.

.. code-block::

@ARTICLE{bluepyopt,
AUTHOR={Van Geit, Werner and Gevaert, Michael and Chindemi, Giuseppe and Rössert, Christian and Courcol, Jean-Denis and Muller, Eilif Benjamin and Schürmann, Felix and Segev, Idan and Markram, Henry},
TITLE={BluePyOpt: Leveraging open source software and cloud infrastructure to optimise model parameters in neuroscience},
JOURNAL={Frontiers in Neuroinformatics},
VOLUME={10},
YEAR={2016},
NUMBER={17},
URL={http://www.frontiersin.org/neuroinformatics/10.3389/fninf.2016.00017/abstract},
DOI={10.3389/fninf.2016.00017},
ISSN={1662-5196}
}


Support
=======
We are providing support using a chat channel on `Gitter <https://gitter.im/BlueBrain/BluePyOpt>`_, or the `Github discussion page <https://github.com/BlueBrain/BluePyOpt/discussions>`_.

News
====
- 2017/01/04: BluePyOpt is now considered compatible with Python 3.6+.
- 2016/11/10: BluePyOpt now supports NEURON point processes. This means we can fit parameters of Adex/GIF/Izhikevich models, and also synapse models.
- 2016/06/14: Started a wiki: https://github.com/BlueBrain/BluePyOpt/wiki
- 2016/06/07: The BluePyOpt paper was published in Frontiers in Neuroinformatics (for link, see above)
- 2016/05/03: The API documentation was moved to `ReadTheDocs <http://bluepyopt.readthedocs.io/en/latest/>`_
- 2016/04/20: BluePyOpt now contains the code of the IBEA selector, no need to install a BBP-specific version of DEAP anymore
- 2016/03/24: Released version 1.0

Requirements
============

* `Python 2.7+ <https://www.python.org/download/releases/2.7/>`_ or `Python 3.6+ <https://www.python.org/downloads/release/python-360/>`_
* `Pip <https://pip.pypa.io>`_ (installed by default in newer versions of Python)
* `Neuron 7.4+ <http://neuron.yale.edu/>`_ (compiled with Python support)
* `eFEL eFeature Extraction Library` <https://github.com/BlueBrain/eFEL>`_ (automatically installed by pip)
* `Numpy <http://www.numpy.org>`_ (automatically installed by pip)
* `Pandas <http://pandas.pydata.org/>`_ (automatically installed by pip)
* The instruction below are written assuming you have access to a command shell on Linux / UNIX / MacOSX / Cygwin

Installation
============

If you want to use the ephys module of BluePyOpt, you first need to install NEURON with Python support on your machine.

And then bluepyopt itself:


.. code-block:: bash

pip install bluepyopt


Cloud infrastructure
====================

We provide instructions on how to set up an optimisation environment on cloud
infrastructure or cluster computers
`here <https://github.com/BlueBrain/BluePyOpt/tree/master/cloud-config>`_

Quick Start
===========

Single compartmental model
--------------------------

An iPython notebook with an introductory optimisation of a one compartmental
model with 2 HH channels can be found at

https://github.com/BlueBrain/BluePyOpt/blob/master/examples/simplecell/simplecell.ipynb


.. image:: examples/simplecell/figures/landscape_example.png


**Figure**: The solution space of a single compartmental model with two parameters: the maximal conductance of Na and K ion channels. The color represents how well the model fits two objectives: when injected with two different currents, the model has to fire 1 and 4 action potential respectively during the stimuli. Dark blue is the best fitness. The blue circles represent solutions with a perfect score.

Neocortical Layer 5 Pyramidal Cell
----------------------------------
Scripts for a more complex neocortical L5PC are in
`this directory <https://github.com/BlueBrain/BluePyOpt/tree/master/examples/l5pc>`__

With a notebook:

https://github.com/BlueBrain/BluePyOpt/blob/master/examples/l5pc/L5PC.ipynb

Thalamocortical Cells
---------------------
Scripts for 2 thalamocortical cell types are in
`this directory <https://github.com/BlueBrain/BluePyOpt/tree/master/examples/thalamocortical-cell>`__

With a notebook:

https://github.com/BlueBrain/BluePyOpt/blob/master/examples/thalamocortical-cell/thalamocortical-cell_opt.ipynb


Tsodyks-Markram Model of Short-Term Plasticity
----------------------------------------------
Scripts for 2 version of fitting the Tsodyks-Markram model to synaptic traces are in
`this directory <https://github.com/BlueBrain/BluePyOpt/tree/master/examples/tsodyksmarkramstp>`__

With 2 notebooks:

https://github.com/BlueBrain/BluePyOpt/blob/master/examples/tsodyksmarkramstp/tsodyksmarkramstp.ipynb
https://github.com/BlueBrain/BluePyOpt/blob/master/examples/tsodyksmarkramstp/tsodyksmarkramstp_multiplefreqs.ipynb

API documentation
=================
The API documentation can be found on `ReadTheDocs <http://bluepyopt.readthedocs.io/en/latest/>`_.

Funding
=======
This work has been partially funded by the European Union Seventh Framework Program (FP7/2007­2013) under grant agreement no. 604102 (HBP), the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 720270, 785907 (Human Brain Project SGA1/SGA2) and by the EBRAINS research infrastructure, funded from the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 945539 (Human Brain Project SGA3).
<<<<<<< HEAD:README.rst
This project/research was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology.

© 2016-2021, Blue Brain Project/EPFL

..
The following image is also defined in the index.rst file, as the relative path is
different, depending from where it is sourced.
The following location is used for the github README
The index.rst location is used for the docs README; index.rst also defined an end-marker,
to skip content after the marker 'substitutions'.

.. substitutions
.. |banner| image:: docs/source/logo/BluePyOptBanner.png
.. |landscape_example| image:: examples/simplecell/figures/landscape_example.png
=======
- This project/research was supported by funding to the Blue Brain Project, a research center of the École polytechnique fédérale de Lausanne (EPFL), from the Swiss government’s ETH Board of the Swiss Federal Institutes of Technology.
>>>>>>> neuronunit_reduced_cells:README.md
15 changes: 11 additions & 4 deletions bluepyopt/deapext/optimisations.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ def __init__(self, evaluator=None,
cxpb=1.0,
map_function=None,
hof=None,
selector_name=None):
selector_name=None,
neuronunit=False,
):
"""Constructor

Args:
Expand All @@ -110,7 +112,7 @@ def __init__(self, evaluator=None,
offspring_size (int): Number of offspring individuals in each
generation
eta (float): Parameter that controls how far the crossover and
mutation operator disturbe the original individuals
mutation operator perturb the original individuals
mutpb (float): Mutation probability
cxpb (float): Crossover probability
map_function (function): Function used to map (parallelise) the
Expand All @@ -129,7 +131,7 @@ def __init__(self, evaluator=None,
self.cxpb = cxpb
self.mutpb = mutpb
self.map_function = map_function

self.neuronunit = neuronunit
self.selector_name = selector_name
if self.selector_name is None:
self.selector_name = 'IBEA'
Expand Down Expand Up @@ -302,7 +304,12 @@ def run(self,
stats.register("std", numpy.std)
stats.register("min", numpy.min)
stats.register("max", numpy.max)

if self.neuronunit:
# if neuronunit overwrite path of optimization algorithms
# to get some reduced model relevant customizations.
from neuronunit.optimization import algorithms
else:
from bluepyopt.deapext import algorithms
pop, hof, log, history = algorithms.eaAlphaMuPlusLambdaCheckpoint(
pop,
self.toolbox,
Expand Down
Loading