Giter Site home page Giter Site logo

tvb-multiscale's People

Contributors

bogdanvalean1 avatar dionperd avatar fox8888 avatar gabiflorea10 avatar jchen6727 avatar liadomide avatar popaula937 avatar romina1601 avatar vvbragin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tvb-multiscale's Issues

PyNESTML no longer provides `install_nest`

With the release of PyNESTML 5, the utils file utils/model_installer.py is no longer part of PyNESTML, and my TVB Multiscale installation (branch rising-net) errors out:

from tvb_multiscale.tvb_nest.config import CONFIGURED
from tvb_multiscale.tvb_nest.nest_models.builders.nest_factory import compile_modules
compile_modules("cereb", recompile=True, config=CONFIGURED)
Output exceeds the [size limit](command:workbench.action.openSettings?%5B%22notebook.output.textLineLimit%22%5D). Open the full output data [in a text editor](command:workbench.action.openLargeOutput?147f028d-87a9-4ed5-8e5a-bb6bfe4be8b2)
2023-01-11 16:39:22,306 - INFO - tvb_multiscale.tvb_nest.config - Loading a NEST instance...
2023-01-11 16:39:22,306 - INFO - tvb_multiscale.tvb_nest.config - Loading a NEST instance...
2023-01-11 16:39:22,309 - INFO - tvb_multiscale.tvb_nest.config - NEST_INSTALL_DIR: /home/docker/env/neurosci/nest_build
2023-01-11 16:39:22,309 - INFO - tvb_multiscale.tvb_nest.config - NEST_INSTALL_DIR: /home/docker/env/neurosci/nest_build
2023-01-11 16:39:22,310 - INFO - tvb_multiscale.tvb_nest.config - NEST_DATA_DIR: /home/docker/env/neurosci/nest_build/share/nest
2023-01-11 16:39:22,310 - INFO - tvb_multiscale.tvb_nest.config - NEST_DATA_DIR: /home/docker/env/neurosci/nest_build/share/nest
2023-01-11 16:39:22,312 - INFO - tvb_multiscale.tvb_nest.config - NEST_DOC_DIR: /home/docker/env/neurosci/nest_build/share/doc/nest
2023-01-11 16:39:22,312 - INFO - tvb_multiscale.tvb_nest.config - NEST_DOC_DIR: /home/docker/env/neurosci/nest_build/share/doc/nest
2023-01-11 16:39:22,313 - INFO - tvb_multiscale.tvb_nest.config - NEST_MODULE_PATH: /home/docker/env/neurosci/nest_build/lib/nest
2023-01-11 16:39:22,313 - INFO - tvb_multiscale.tvb_nest.config - NEST_MODULE_PATH: /home/docker/env/neurosci/nest_build/lib/nest
2023-01-11 16:39:22,315 - INFO - tvb_multiscale.tvb_nest.config - PATH: /home/docker/env/neurosci/nest_build/bin:/home/docker/env/neurosci/bin:/home/docker/.vscode-server/bin/e8a3071ea4344d9d48ef8a4df2c097372b0c5161/bin/remote-cli:/home/docker/env/neurosci/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
2023-01-11 16:39:22,315 - INFO - tvb_multiscale.tvb_nest.config - PATH: /home/docker/env/neurosci/nest_build/bin:/home/docker/env/neurosci/bin:/home/docker/.vscode-server/bin/e8a3071ea4344d9d48ef8a4df2c097372b0c5161/bin/remote-cli:/home/docker/env/neurosci/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
2023-01-11 16:39:22,317 - INFO - tvb_multiscale.tvb_nest.config - LD_LIBRARY_PATH: /home/docker/env/neurosci/nest_build/lib/nest::/home/docker/env/neurosci/nest_build/lib/nest
2023-01-11 16:39:22,317 - INFO - tvb_multiscale.tvb_nest.config - LD_LIBRARY_PATH: /home/docker/env/neurosci/nest_build/lib/nest::/home/docker/env/neurosci/nest_build/lib/nest
2023-01-11 16:39:22,320 - INFO - tvb_multiscale.tvb_nest.config - SLI_PATH: /home/docker/env/neurosci/nest_build/share/nest/sli
2023-01-11 16:39:22,320 - INFO - tvb_multiscale.tvb_nest.config - SLI_PATH: /home/docker/env/neurosci/nest_build/share/nest/sli
2023-01-11 16:39:22,322 - INFO - tvb_multiscale.tvb_nest.config - NEST_PYTHON_PREFIX: /home/docker/env/neurosci/nest_build/lib/python3.9/site-packages
2023-01-11 16:39:22,322 - INFO - tvb_multiscale.tvb_nest.config - NEST_PYTHON_PREFIX: /home/docker/env/neurosci/nest_build/lib/python3.9/site-packages
2023-01-11 16:39:22,324 - INFO - tvb_multiscale.tvb_nest.config - system path: ['/home/docker/env/neurosci/nest_build/lib/python3.9/site-packages', '/home/docker/my_tvb_multiscale_files2/tvb_nest/notebooks/cerebellum/working_files', '/home/docker/env/neurosci', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '', '/home/docker/env/neurosci/lib/python3.9/site-packages', '/home/docker/env/neurosci/lib/python3.9/site-packages/sympy-1.11rc1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/antlr4_python3_runtime-4.10-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/mpmath-1.2.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/pyerfa-2.0.0.1-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/PyYAML-6.0-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/pyspike-0.7.0-py3.9-linux-aarch64.egg', '/home/docker/packages/tvb-root/tvb_library', '/home/docker/env/neurosci/lib/python3.9/site-packages/PyLEMS-0.6.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/numexpr-2.8.4-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/networkx-3.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/Mako-1.2.4-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/ipywidgets-8.0.4-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/Deprecated-1.2.13-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/autopep8-2.0.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/jupyterlab_widgets-3.0.5-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/widgetsnbextension-4.0.5-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/wrapt-1.14.1-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/pycodestyle-2.10.0-py3.9.egg', '/home/docker/packages/tvb-root/tvb_framework', '/home/docker/env/neurosci/lib/python3.9/site-packages/tvb_library-2.7.2-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/tvb_gdist-2.1.0-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/tvb_data-2.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/tables-3.7.0-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/simplejson-3.18.1-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/siibra-0.3a27-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/requests_toolbelt-0.10.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/python_keycloak-2.8.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/nibabel-4.0.2-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/matplotlib-3.5.3-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/gevent-22.10.2-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/FormEncode-2.0.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/flask_restx-1.0.3-py3.9.egg', '/home/docker/packages/tvb-root/tvb_storage', '/home/docker/env/neurosci/lib/python3.9/site-packages/pyAesCrypt-6.0.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/kubernetes-25.3.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/cryptography-39.0.0-py3.9-linux-aarch64.egg', '/home/docker/packages/tvb-root/tvb_contrib', '/home/docker/packages/tvb-multiscale', '/home/docker/.local/lib/python3.9/site-packages', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.9/dist-packages']
2023-01-11 16:39:22,324 - INFO - tvb_multiscale.tvb_nest.config - system path: ['/home/docker/env/neurosci/nest_build/lib/python3.9/site-packages', '/home/docker/my_tvb_multiscale_files2/tvb_nest/notebooks/cerebellum/working_files', '/home/docker/env/neurosci', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '', '/home/docker/env/neurosci/lib/python3.9/site-packages', '/home/docker/env/neurosci/lib/python3.9/site-packages/sympy-1.11rc1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/antlr4_python3_runtime-4.10-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/mpmath-1.2.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/pyerfa-2.0.0.1-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/PyYAML-6.0-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/pyspike-0.7.0-py3.9-linux-aarch64.egg', '/home/docker/packages/tvb-root/tvb_library', '/home/docker/env/neurosci/lib/python3.9/site-packages/PyLEMS-0.6.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/numexpr-2.8.4-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/networkx-3.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/Mako-1.2.4-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/ipywidgets-8.0.4-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/Deprecated-1.2.13-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/autopep8-2.0.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/jupyterlab_widgets-3.0.5-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/widgetsnbextension-4.0.5-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/wrapt-1.14.1-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/pycodestyle-2.10.0-py3.9.egg', '/home/docker/packages/tvb-root/tvb_framework', '/home/docker/env/neurosci/lib/python3.9/site-packages/tvb_library-2.7.2-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/tvb_gdist-2.1.0-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/tvb_data-2.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/tables-3.7.0-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/simplejson-3.18.1-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/siibra-0.3a27-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/requests_toolbelt-0.10.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/python_keycloak-2.8.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/nibabel-4.0.2-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/matplotlib-3.5.3-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/gevent-22.10.2-py3.9-linux-aarch64.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/FormEncode-2.0.1-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/flask_restx-1.0.3-py3.9.egg', '/home/docker/packages/tvb-root/tvb_storage', '/home/docker/env/neurosci/lib/python3.9/site-packages/pyAesCrypt-6.0.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/kubernetes-25.3.0-py3.9.egg', '/home/docker/env/neurosci/lib/python3.9/site-packages/cryptography-39.0.0-py3.9-linux-aarch64.egg', '/home/docker/packages/tvb-root/tvb_contrib', '/home/docker/packages/tvb-multiscale', '/home/docker/.local/lib/python3.9/site-packages', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.9/dist-packages']

              -- N E S T --
  Copyright (C) 2004 The NEST Initiative

 Version: HEAD@c545255f7
...
2023-01-11 16:39:22,814 - INFO - tvb_multiscale.tvb_nest.nest_models.builders.nest_factory - Compiling cereb...
2023-01-11 16:39:22,814 - INFO - tvb_multiscale.tvb_nest.nest_models.builders.nest_factory - Compiling cereb...
2023-01-11 16:39:22,816 - INFO - tvb_multiscale.tvb_nest.nest_models.builders.nest_factory - in build directory /home/docker/packages/nest_modules_builds/cereb...
2023-01-11 16:39:22,816 - INFO - tvb_multiscale.tvb_nest.nest_models.builders.nest_factory - in build directory /home/docker/packages/nest_modules_builds/cereb...
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[1], line 3
      1 from tvb_multiscale.tvb_nest.config import CONFIGURED
      2 from tvb_multiscale.tvb_nest.nest_models.builders.nest_factory import compile_modules
----> 3 compile_modules("cereb", recompile=True, config=CONFIGURED)
      4 # WORKDIR = os.getcwd()
      5 # HOMEDIR = WORKDIR.split("examples")[0]
      6 # MODULEDIR = os.path.join(HOMEDIR, "tvb_nest/nest/modules/cereb")
      7 # MODULEBUILDS = os.environ['MYMODULES_BLD_DIR']
      8 # os.chdir(MODULEBUILDS)

File ~/packages/tvb-multiscale/tvb_multiscale/tvb_nest/nest_models/builders/nest_factory.py:97, in compile_modules(modules, recompile, config, logger)
     95 logger.info("in build directory %s..." % module_bld_dir)
     96 success_message = "DONE compiling and installing %s!" % module
---> 97 from pynestml.frontend.pynestml_frontend import install_nest
     98 try:
     99     install_nest(module_bld_dir, config.NEST_PATH)

ImportError: cannot import name 'install_nest' from 'pynestml.frontend.pynestml_frontend' (/home/docker/env/neurosci/lib/python3.9/site-packages/pynestml/frontend/pynestml_frontend.py)

A problem of TVB-ANNarchy_DBS_BasalGanglia.

Dear developers.
I try to learn the TVB-ANNarchy_DBS_BasalGanglia file to know about the tvb-muliscale. But there is a question about ANNarchy. Sorry I am not very familiar with that. So can you help me to answer the question?
The problem is about compiling the network. And there isn't any error up to this line of code. Here is the shot screen below.
1694792789687
Thanks for your attention. Waiting for your reply.

Including own NEST neuron models in the tvb-multiscale docker container: NEST version?

Dear developers,

I have a question concerning the use of NEST in the tvb-multiscale docker container. Since the NEST support platforms could not help me, I am hoping this is the right place to ask the question. If not, please let me know.

To include a spiking neuronal network model of the thalamus within a whole-brain model, built with tvb, I am using the tvb-multiscale docker container in Vscode on my windows PC. I am using a python 3 interpreter. So far, this has worked perfectly. However, to make a more realistic model of the thalamus, I need to install a custom version of a NEST neuron model (which is able to better simulate the behavior of thalamic neurons). To try if installing extension modules at all in this setup is possible, I've followed these steps: https://nest-extension-module.readthedocs.io/en/latest/extension_modules.html to install this example nest-extension-module: https://github.com/nest/nest-extension-module .

Using Cmake like this in the terminal in the container works perfectly well. Using:
(neurosci) docker@84fabd16af99:~/mmb$ cmake -Dwith-nest=/home/docker/env/neurosci/nest_build/bin/nest-config ../nest-extension-module-master
I get the message:

You can now build and install 'mymodule' using
  make
  make install

The library file libmymodule.so will be installed to
  /home/docker/env/neurosci/nest_build/lib/nest/
Help files will be installed to
  /home/docker/env/neurosci/nest_build/share/doc/nest

The module can be loaded into NEST using
  nest.Install('mymodule')  (in PyNEST)
  (mymodule) Install        (in SLI)

-- Configuring done
-- Generating done
-- Build files have been written to: /home/docker/mmb

However, when I try to "make", I get a long list of errors of which the first one is:

In file included from /home/docker/nest-extension-module-master/src/mymodule.cpp:30:
/home/docker/nest-extension-module-master/src/pif_psc_alpha.h:92:1: error: expected class-name before ‘{’ token
 {
 ^
/home/docker/nest-extension-module-master/src/pif_psc_alpha.h:115:21: error: type ‘nest::Node’ is not a base type for type ‘mynest::pif_psc_alpha’
   using nest::Node::handle;

According to a NEST developer, the most probable reason is that there is an old NEST version installed in the image (master@1e0ce51, dated Oct 12, 2020). If so, would it be possible for your to update the version of NEST in the container?

If this is not the problem, do you know if it is possible to install self-defined NEST models in the tvb-multiscale container and how?

I hope the problem is clear and this is the right place to ask. Thank you in advance and have a nice day!

Kind regards,
Nina

Example notebooks for parallel branch

Dear @dionperd,

I raised an issue last time about the use of NEST 3.1 in TVB_multiscale.

I am using the docker image I built from the parallelNEST31 branch. Currently, I am trying to implement a spiking-neuronal network model of the thalamus into a whole-brain TVB model. Both the thalamus model in NEST, and the whole-brain model in TVB work perfectly separately with this docker image. So now I want to use tvb-multiscale to combine the two.

I started following the workflow described in the example notebooks of the master branch, so the WilsonCowan.ipynb and the RedWongWang.ipynb but quite some errors occur because I guess there are quite some changes in functions between the paralellNEST31 and the master (for example in the default_exc_io_inh_i.py).

There are adjusted notebooks in the parallel branch, but somehow I cannot open or download these: https://github.com/the-virtual-brain/tvb-multiscale/blob/parallelNEST31/docs/documented_example_notebooks/RedWongWang.ipynb.
I don't know if that is a general problem or if I am doing something wrong.

When I try adapting the old workflow, everything goes well up to building the spiking network: nest_network = nest_model_builder.build_spiking_network(). Even though I think I did everything right with respect to the output_devices I get this error:

TraitTypeError: Attribute can't be set to an instance of <class 'list'>
  attribute tvb_multiscale.core.spiking_models.network.SpikingNetwork.output_devices = Attr(field_type=<class 'pandas.core.series.Series'>, default=Series([], dtype: float64), required=True)

Maybe I did make a mistake somewhere, let me know if I should provide some of my code. But I think it would greatly help to have updated example notebooks with workflows I can follow!

Thanks in advance and have a nice day :)

TVB-NEST interface with the JansenRit meanfield model

Hello again,

As mentioned before, I am attempting to include a NEST spiking network model of the thalamus into a TVB whole-brain network which uses the JansenRit meanfield model. I am working on the ParallelNEST31 branch, and using python 3.9.2. I am trying to adapt the minimal Wilson Cowan example notebook such that it will work with the JansenRit TVB model.

The main differences between WilsonCowan and JansenRit are of course the state- and coupling variables. While in Wilson Cowan these variables represent rate, in Jansen Rit we can only work with the post-synaptic potentials (y0, y1 and y2, of which only y1 and y2 are coupling variables). I would like to convert these PSPs to a spike rate that can be inputted into a TVB proxy node (so a NEST spike generating device). As I understand, I can do this by defining a new transformer class, that does this operation from PSP to spikerate. Thus, I am writing this: class Sigmoid(Transformer) in the core.interfaces.base.transformers.models.base.py. And I have also added this new transformer to the DefaultTVBtoSpikeNetTransformers in the builders.py. The operation of the transformer will be very similar to the one in the SigmoidalJansenRit TVB coupling class. Thus, it will need both y1 and y2 as inputs. So in the main file I have defined:

    tvb_spikeNet_model_builder.output_interfaces = \
        [{'voi': np.array(["y1", "y2"]),         # TVB state variables to get data from
          'populations': np.array(["TC"]), # NEST populations to couple to
          'model': 'RATE',                # This can be used to set default tranformer and proxy models
          'coupling_mode': 'TVB',         # or "spikeNet", "NEST", etc
          'proxy_inds': nest_nodes_ids,  # TVB proxy region nodes' indices
          'proxy_model': "RATE",  
          'transformer_model': "SIGMOID",  
          'spiking_proxy_inds': nest_nodes_ids  # Same as "proxy_inds" for this kind of interface
         }
        ]

However, I get this error when trying ot configure the tvb_spikeNet_model_builder:

Exception has occurred: ValueError
2 is not in list
  File "/home/docker/packages/tvb-multiscale/tvb_multiscale/core/interfaces/tvb/interfaces.py", line 60, in <listcomp>
    return np.array([simulator_inds_list.index(ind) for ind in inds])
  File "/home/docker/packages/tvb-multiscale/tvb_multiscale/core/interfaces/tvb/interfaces.py", line 60, in _set_local_indices
    return np.array([simulator_inds_list.index(ind) for ind in inds])
  File "/home/docker/packages/tvb-multiscale/tvb_multiscale/core/interfaces/tvb/interfaces.py", line 67, in set_local_voi_indices
    self.voi_loc = self._set_local_indices(self.voi, monitor_voi)

I think this occurs because self.voi contains the absolute indices of the voi's wrt all the possible vois, so it is [1,2] (y1 and y2), while monitor_voi is set to be the indices of the coupling variables, so [0, 1] because the only coupling variables are y1 and y2.

Am I making a mistake or is something wrong with the code? I can circumvent the error when in core.interfaces.tvb.interfaces.py --> TVBInterface --> set_local_voi_indices, I change self.voi_loc = self._set_local_indices(self.voi, monitor_voi) to 'self.voi_loc = monitor_voi'.
But this might cause problems later?

Then the next problem is that I need to use both y1 and y2 in the Sigmoid(Transformer) class to compute the output_buffer. It is unclear to me how to extract y1 and y2 from the input_buffer. If input_buffer would already be (y1-y2), the class would look something like this I think:

class Sigmoid(Transformer):
    """
        Sigmoid Transformer applies a sigmoid function to the input in order to compute the output.
        It comprises of:
            - an input buffer data numpy.array,
            - an output buffer data numpy.array,
            - the parameters of the sigmoid function,
            - a method to apply the sigmoid to the input buffer.

        .. math::
        c_{min} + (c_{max} - c_{min}) / (1.0 + \exp(-a(x-midpoint)/\sigma))
    """
    cmin = NArray(
        label=":math:`c_{min}`",
        default=np.array([0.0,]),
        domain=Range(lo=-1000.0, hi=1000.0, step=10.0),
        doc="Minimum of the sigmoid function",)

    cmax = NArray(
        label=":math:`c_{max}`",
        default=np.array([2.0 * 0.0025,]),
        domain=Range(lo=-1000.0, hi=1000.0, step=10.0),
        doc="Maximum of the sigmoid function",)

    midpoint = NArray(
        label="midpoint",
        default=np.array([6.0,]),
        domain=Range(lo=-1000.0, hi=1000.0, step=10.0),
        doc="Midpoint of the linear portion of the sigmoid",)

    r  = NArray(
        label=r":math:`r`",
        default=np.array([1.0,]),
        domain=Range(lo=0.01, hi=1000.0, step=10.0),
        doc="the steepness of the sigmoidal transformation",)

    a = NArray(
        label=r":math:`a`",
        default=np.array([1.0,]),
        domain=Range(lo=0.01, hi=1000.0, step=10.0),
        doc="Scaling of the coupling term",)

    @property
    def _a(self):
        return self._assert_size("a")

    def configure(self):
        super(Sigmoid, self).configure()
        self._a

    def compute(self):
        """Method that just scales input buffer data to compute the output buffer data."""
        if isinstance(self.input_buffer, np.ndarray):
            self.output_buffer = self.a * self.cmax / (1.0 + np.exp(self.r * (self.midpoint - self.input_buffer)))
        else:
            self.output_buffer = []
            for a, input_buffer in zip(self._a, self.input_buffer):
                self.output_buffer.append(self.a * self.cmax / (1.0 + np.exp(self.r * (self.midpoint - self.input_buffer))))

    def print_str(self):
        return super(Scale, self).print_str() + \
               "\n     - a = %s" % str(self.a)

So the question now is how to obtain y1 and y2 separately to use them properly.

The NESTtoTVB interface will also be a problem since the NEST model will output through a spike recorder, but the TVB node needs to have both it's cvars overwritten which are y1 and y2. And these are difficult to relate to the spiking rate of the pyramidal neurons. One option would maybe be to apply the inverse sigmoid function to this spikerate, and then write this all to y1, and set y2 to zero. Another option would be to just write spikerate to y1 and then change the coupling function of the TVB model specifically for couplings between the thalamus nodes and other nodes.

For the first option, how would I go about writing a transformer that writes specific things to y1 and y2?

I hope the questions are clear and relevant. If I could better ask these questions through another method/platform, please let me know. Also let me know if any additional information could be of help.

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.