Coder Social home page Coder Social logo

spikedetectorfuse's Introduction

Spike Detector Fuse for NEST

This module monitors the spiking activity of the network, and throws a python exception if the spiking activity goes beyond the given threshold for the given length of time. See the comments in the code for more details.

It is a module for the NEST simulator.

Installation

With the appropriate nest-config in your PATH run ./install.sh in the root directory.

Once the installation is done, add /path/to/nest/installation/lib/nest/ to your LD_LIBRARY_PATH environment variable.

Usage

import nest
nest.Install('spikedetfusemodule')
...  # Create your neurons and connect up your network
spike_det = nest.Create('spike_detector_fuse')
nest.Connect(neurons, spike_det)
# Setting termination criterion
nest.SetStatus(spike_det, {'frequency_thresh':200.0, 'length_thresh':50.0, 'n_connected_neurons':len(exc_neurons)})
...  # Run your simulation
try:
    nest.Simulate(200)
except nest.NESTError as E:
    E_msg = E.args[0]
    if E_msg.startswith('UnstableSpiking'):
        print(E_msg)
    else:
        raise

In this example, if your average network activity stays beyond 200Hz for longer than 50ms, a nest.NESTError will be thrown with message 'UnstableSpiking in Simulate_d: The Network seems to be in a regime of unstable spiking, terminating simulation'

Important notes

  • nest.Simulate() cannot be run again without resetting the kernel by running nest.ResetKernel() once an unstable spiking exception is thrown
  • Data upto the simulation slice where the exception is thrown can be safely retrieved and parsed even if the above exception is thrown.

spikedetectorfuse's People

Contributors

anandtrex avatar maharjun avatar

Watchers

 avatar  avatar  avatar  avatar

spikedetectorfuse's Issues

Write Proper Tests which check for realistic spike rates

The current tests end up with an instantaneous blowup in activity which naturally causes UnstableException to be thrown by all the nest threads at the same time slice. Hence it is not a valid test for the error throwing synchronization.

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.