snntoolbox.bin

snntoolbox.bin.run

The purpose of this module is to provide an executable for running the SNN conversion toolbox, either from terminal or using a GUI.

During installation of the toolbox, python creates an entry point to the main function of this module. See Getting started for how call this executable.

@author: rbodo

snntoolbox.bin.run.main(filepath=None)[source]

Entry point for running the toolbox.

Note

There is no need to call this function directly, because python sets up an executable during Installation that can be called from terminal.

snntoolbox.bin.utils

This module bundles all the tools of the SNN conversion toolbox.

Important functions:

run_pipeline Convert an analog network to a spiking network and simulate it.
update_setup Update default settings with user settings and check they are valid.

@author: rbodo

snntoolbox.bin.utils.run_pipeline(config, queue=None)[source]

Convert an analog network to a spiking network and simulate it.

Complete pipeline of
  1. loading and testing a pretrained ANN,
  2. normalizing parameters
  3. converting it to SNN,
  4. running it on a simulator,
  5. given a specified hyperparameter range params, repeat simulations with modified parameters.
Parameters:
  • config (configparser.ConfigParser) – ConfigParser containing the user settings.
  • queue (Optional[Queue.Queue]) – Results are added to the queue to be displayed in the GUI.
Returns:

results – List of the accuracies obtained after simulating with each parameter value in config.get(‘parameter_sweep’, ‘param_values’).

Return type:

list

snntoolbox.bin.utils.is_stop(queue)[source]

Determine if the user pressed ‘stop’ in the GUI.

Parameters:queue (Queue.Queue) – Event queue.
Returns:True if user pressed ‘stop’ in GUI, False otherwise.
Return type:bool
snntoolbox.bin.utils.run_parameter_sweep(config, queue)[source]

Decorator to perform a parameter sweep using the run_single function. Need an aditional wrapping layer to be able to pass decorator arguments.

snntoolbox.bin.utils.import_target_sim(config)[source]
snntoolbox.bin.utils.load_config(filepath)[source]

Load a config file from filepath.

snntoolbox.bin.utils.update_setup(config_filepath)[source]

Update default settings with user settings and check they are valid.

Load settings from configuration file at config_filepath, and check that parameter choices are valid. Non-specified settings are filled in with defaults.

snntoolbox.bin.utils.initialize_simulator(config)[source]

Import a module that contains utility functions of spiking simulator.

snntoolbox.bin.utils.get_log_keys(config)[source]
snntoolbox.bin.utils.get_plot_keys(config)[source]
snntoolbox.bin.utils.config_string_to_set_of_strings(string)[source]

snntoolbox.bin.gui

snntoolbox.bin.gui.gui