NALSM: Neuron-Astrocyte Liquid State Machine

Related tags

Deep LearningNALSM
Overview

NALSM: Neuron-Astrocyte Liquid State Machine

This package is a Tensorflow implementation of the Neuron-Astrocyte Liquid State Machine (NALSM) that introduces astrocyte-modulated STDP to the Liquid State Machine learning framework for improved accuracy performance and minimal tuning.

The paper has been accepted at NeurIPS 2021, available here.

Citation

Vladimir A. Ivanov and Konstantinos P. Michmizos. "Increasing Liquid State Machine Performance with Edge-of-Chaos Dynamics Organized by Astrocyte-modulated Plasticity." 35th Conference on Neural Information Processing Systems (NeurIPS 2021).

@inproceedings{ivanov_2021,
author = {Ivanov, Vladimir A. and Michmizos, Konstantinos P.},
title = {Increasing Liquid State Machine Performance with Edge-of-Chaos Dynamics Organized by Astrocyte-modulated Plasticity},
year = {2021},
pages={1--10},
booktitle = {35th Conference on Neural Information Processing Systems (NeurIPS 2021)}
}

Software Installation

  • Python 3.6.9
  • Tensorflow 2.1 (with CUDA 11.2 using tensorflow.compat.v1)
  • Numpy
  • Multiprocessing

Usage

This code performs the following functions:

  1. Generate the 3D network
  2. Train NALSM
  3. Evaluate trained model accuracy
  4. Evaluate trained model branching factor
  5. Evaluate model kernel quality

Instructions for obtaining/setting up datasets can be accessed here.

Overview of all files can be accessed here.

1. Generate 3D Network

To generate the 3D network, enter the following command:

python generate_spatial_network.py

This will prompt for following inputs:

  • WHICH_DATASET_TO_GENERATE_NETWORK_FOR? [TYPE M FOR MNIST/ N FOR NMNIST] : enter M to make a network with an input layer sized for MNIST/Fashion-MNIST or N for N-MNIST.
  • NETWORK_NUMBER_TO_CREATE? [int] : enter an integer to label the network.
  • SIZE_OF_LIQUID_DIMENSION_1? [int] : enter an integer representing the number of neurons to be in dimension 1 of liquid.
  • SIZE_OF_LIQUID_DIMENSION_2? [int] : enter an integer representing the number of neurons to be in dimension 2 of liquid.
  • SIZE_OF_LIQUID_DIMENSION_3? [int] : enter an integer representing the number of neurons to be in dimension 3 of liquid.

The run file will generate the network and associated log file containing data about the liquid (i.e. connection densities) in sub-directory

/ /networks/ .

2. Train NALSM

2.1 MNIST

To train NALSM model on MNIST, enter the following command:

python NALSM_RUN_MAIN_SIM_MNIST.py

This will prompt for the following inputs:

  • GPU? : enter an integer specifying the gpu to use for training.
  • VERSION? [int] : enter an integer to label the training simulation.
  • NET_NUM_VAR? [int] : enter the number of the network created in Section 1.
  • BATCH_SIZE? [int] : specify the number of samples to train at same time (batch), for liquids with 1000 neurons, batch size of 250 will work on a 12gb gpu. For larger liquids(8000), smaller batch sizes of 50 should work.
  • BATCHS_PER_BLOCK? [int] : specify number of batchs to keep in memory for training output layer, we found 2500 samples works well in terms of speed and memory (so for batch size of 250, this should be set to 10 (10 x 250 = 2500), for batch size 50 set this to 50 (50 x 50 = 2500).
  • ASTRO_W_SCALING? [float] : specify the astrocyte weight detailed in equation 7 of paper. We used 0.015 for all 1000 neuron liquids, and 0.0075 for 8000 neuron liquids. Generally accuracy peaks with a value around 0.01 (See Appendix).

This will generate all output in sub-directory

/ /train_data/ver_XX/ where XX is VERSION number.

2.2 N-MNIST

To train NALSM model on N-MNIST, enter the following command:

python NALSM_RUN_MAIN_SIM_N_MNIST.py

All input prompts and output are the same as described above for run file NALSM_RUN_MAIN_SIM_MNIST.py.

2.3 Fashion-MNIST

To train NALSM model on Fashion-MNIST, enter the following command:

python NALSM_RUN_MAIN_SIM_F_MNIST.py

All input prompts and output are the same as described above for run file NALSM_RUN_MAIN_SIM_MNIST.py.

Instructions for training other benchmarked LSM models can be accessed here.

3. Evaluate Trained Model Accuracy

To get accuracy of a trained model, enter the following command:

python get_test_accuracy.py

The run file will prompt for following inputs:

  • VERSION? [int] : enter the version number of the trained model

This will find the epoch with maximum validation accuracy and return the test accuracy for that epoch.

4. Evaluate Model Branching Factor

To compute the branching factor of a trained model, enter the following command:

python compute_branching_factor.py

The run file will prompt for following inputs:

  • VERSION? [int] : enter the version number of the trained model.

The trained model directory must have atleast one .spikes file, which contains millisecond spike data of each neuron for 20 arbitrarily selected input samples in a batch. The run file will generate a .bf file with same name as the .spikes file.

To read the generated .bf file, enter the following command:

python get_branching_factor.py

The run file will prompt for following inputs:

  • VERSION? [int] : enter the version number of the trained model.

The run file will print the average branching factor over the 20 samples.

5. Evaluate Model Kernel Quality

Model liquid kernel quality was calculated from the linear speration (SP) and generalization (AP) metrics for MNIST and N-MNIST datasets. To compute SP and AP metrics, first noisy spike counts must be generated for the AP metric, as follows.

To generate noisy spike counts for NALSM model on MNIST, enter the following command:

python NALSM_RUN_MAIN_SIM_MNIST_NOISE.py

The run file requires a W_INI.wdata file (the initialized weights), which should have been generated during model training.

The run file will prompt for the following inputs:

  • GPU? : enter an integer to select the gpu for the training simulation.
  • VERSION? [int] : enter the version number of the trained model.
  • NET_NUM_VAR? [int] : enter the network number of the trained model.
  • BATCH_SIZE? [int] : use the same value used for training the model.
  • BATCHS_PER_BLOCK? [int] : use the same value used for training the model.

The run file will generate all output in sub-directory

/ /train_data/ver_XX/ where XX is VERSION number.

To generate noisy spike counts for NALSM model on N-MNIST, enter the following command:

python NALSM_RUN_MAIN_SIM_N_MNIST_NOISE.py

As above, the run file requires 'W_INI.wdata' file. All input prompts and output are the same as described above for run file NALSM_RUN_MAIN_SIM_MNIST_NOISE.py.

After generating the noisy spike counts, to compute the SP and AP metrics for each trained model enter the following command:

python compute_SP_AP_kernel_quality_measures.py

The run file will prompt for inputs:

  • VERSION? [int] : enter the version number of the trained model.
  • DATASET_MODEL_WAS_TRAINED_ON? [TYPE M FOR MNIST/ N FOR NMNIST] : enter dataset the model was trained on. The run file will print out the SP and AP metrics.

Instructions for evaluating kernel quality for other benchmarked LSM models can be accessed here.

Owner
Computational Brain Lab
Computational Brain Lab @ Rutgers University
Computational Brain Lab
g2o: A General Framework for Graph Optimization

g2o - General Graph Optimization Linux: Windows: g2o is an open-source C++ framework for optimizing graph-based nonlinear error functions. g2o has bee

Rainer Kümmerle 2.5k Dec 30, 2022
Automatic tool focused on deriving metallicities of open clusters

metalcode Automatic tool focused on deriving metallicities of open clusters. Based on the method described in Pöhnl & Paunzen (2010, https://ui.adsabs

2 Dec 13, 2021
AdelaiDepth is an open source toolbox for monocular depth prediction.

AdelaiDepth is an open source toolbox for monocular depth prediction.

Adelaide Intelligent Machines (AIM) Group 743 Jan 01, 2023
Group Fisher Pruning for Practical Network Compression(ICML2021)

Group Fisher Pruning for Practical Network Compression (ICML2021) By Liyang Liu*, Shilong Zhang*, Zhanghui Kuang, Jing-Hao Xue, Aojun Zhou, Xinjiang W

Shilong Zhang 129 Dec 13, 2022
DLFlow is a deep learning framework.

DLFlow是一套深度学习pipeline,它结合了Spark的大规模特征处理能力和Tensorflow模型构建能力。利用DLFlow可以快速处理原始特征、训练模型并进行大规模分布式预测,十分适合离线环境下的生产任务。利用DLFlow,用户只需专注于模型开发,而无需关心原始特征处理、pipeline构建、生产部署等工作。

DiDi 152 Oct 27, 2022
Mixup for Supervision, Semi- and Self-Supervision Learning Toolbox and Benchmark

OpenSelfSup News Downstream tasks now support more methods(Mask RCNN-FPN, RetinaNet, Keypoints RCNN) and more datasets(Cityscapes). 'GaussianBlur' is

AI Lab, Westlake University 332 Jan 03, 2023
PoseCamera is python based SDK for human pose estimation through RGB webcam.

PoseCamera PoseCamera is python based SDK for human pose estimation through RGB webcam. Install install posecamera package through pip pip install pos

WonderTree 7 Jul 20, 2021
GAT - Graph Attention Network (PyTorch) 💻 + graphs + 📣 = ❤️

GAT - Graph Attention Network (PyTorch) 💻 + graphs + 📣 = ❤️ This repo contains a PyTorch implementation of the original GAT paper ( 🔗 Veličković et

Aleksa Gordić 1.9k Jan 09, 2023
Taichi Course Homework Template

太极图形课S1-标题部分 这个作业未来或将是你的开源项目,标题的内容可以来自作业中的核心关键词,让读者一眼看出你所完成的工作/做出的好玩demo 如果暂时未想好,起名时可以参考“太极图形课S1-xxx作业” 如下是作业(项目)展开说明的方法,可以帮大家理清思路,并且也对读者非常友好,请小伙伴们多多参

TaichiCourse 30 Nov 19, 2022
AoT is a system for automatically generating off-target test harness by using build information.

AoT: Auto off-Target Automatically generating off-target test harness by using build information. Brought to you by the Mobile Security Team at Samsun

Samsung 10 Oct 19, 2022
pytorch implementation of openpose including Hand and Body Pose Estimation.

pytorch-openpose pytorch implementation of openpose including Body and Hand Pose Estimation, and the pytorch model is directly converted from openpose

Hzzone 1.4k Jan 07, 2023
Runtime type annotations for the shape, dtype etc. of PyTorch Tensors.

torchtyping Type annotations for a tensor's shape, dtype, names, ... Turn this: def batch_outer_product(x: torch.Tensor, y: torch.Tensor) - torch.Ten

Patrick Kidger 1.2k Jan 03, 2023
Official code for ICCV2021 paper "M3D-VTON: A Monocular-to-3D Virtual Try-on Network"

M3D-VTON: A Monocular-to-3D Virtual Try-On Network Official code for ICCV2021 paper "M3D-VTON: A Monocular-to-3D Virtual Try-on Network" Paper | Suppl

109 Dec 29, 2022
[ICCV2021] IICNet: A Generic Framework for Reversible Image Conversion

IICNet - Invertible Image Conversion Net Official PyTorch Implementation for IICNet: A Generic Framework for Reversible Image Conversion (ICCV2021). D

felixcheng97 55 Dec 06, 2022
Reverse engineering Rosetta 2 in M1 Mac

Project Champollion About this project Rosetta 2 is an emulation mechanism to run the x86_64 applications on Arm-based Apple Silicon with Ahead-Of-Tim

FFRI Security, Inc. 258 Jan 07, 2023
[NeurIPS2021] Code Release of K-Net: Towards Unified Image Segmentation

K-Net: Towards Unified Image Segmentation Introduction This is an official release of the paper K-Net:Towards Unified Image Segmentation. K-Net will a

Wenwei Zhang 423 Jan 02, 2023
An unreferenced image captioning metric (ACL-21)

UMIC This repository provides an unferenced image captioning metric from our ACL 2021 paper UMIC: An Unreferenced Metric for Image Captioning via Cont

hwanheelee 14 Nov 20, 2022
Library for 8-bit optimizers and quantization routines.

bitsandbytes Bitsandbytes is a lightweight wrapper around CUDA custom functions, in particular 8-bit optimizers and quantization functions. Paper -- V

Facebook Research 687 Jan 04, 2023
AI-UPV at IberLEF-2021 DETOXIS task: Toxicity Detection in Immigration-Related Web News Comments Using Transformers and Statistical Models

AI-UPV at IberLEF-2021 DETOXIS task: Toxicity Detection in Immigration-Related Web News Comments Using Transformers and Statistical Models Description

Angel de Paula 0 Jun 08, 2022
Implementation of the state of the art beat-detection, downbeat-detection and tempo-estimation model

The ISMIR 2020 Beat Detection, Downbeat Detection and Tempo Estimation Model Implementation. This is an implementation in TensorFlow to implement the

Koen van den Brink 1 Nov 12, 2021