hjq310 / text-classification-in-memristorsnn

This Pytorch-based framework demonstrates a sentiment analysis task in the IMDB movie reviews dataset using an SNN with a statistic memristor model
GNU General Public License v3.0
19 stars 1 forks source link

snn-with-memristors

Paper available here: Text Classification in Memristor-based Spiking Neural Networks

This is a Pytorch-based sentiment analysis task in the IMDB movie reviews dataset using an SNN with a statistic memristor model here.

This work takes two approaches to obtaining a trained memristor-based SNN: 1) converting a trained ANN to the memristor-based SNN, or 2) training the memristor-based SNN directly.


Two approaches to obtaining a trained memristor-based SNN

Here is the project hierarchy:

How to run

Before running, please make sure you have installed numpy, torch, torchdata, torchtext and argparse.

Run python train.py in the command prompt if you want to convert an ANN to a memristor-based SNN.

Run python train.py --directConversion=False --thres=56.75 if you want to train a memristor-based SNN.

Rum python trian.py --xbar=False to disable virtual memristor arrays.

Please refer to train.py file to see the details regarding other parameters.

Citation

@article{10.1088/2634-4386/acb2f0,
    author={Huang, Jinqi and Serb, Alexantrou and Stathopoulos, Spyros and Prodromakis, Themis},
    title={Text classification in memristor-based spiking neural networks},
    journal={Neuromorphic Computing and Engineering },
    url={http://iopscience.iop.org/article/10.1088/2634-4386/acb2f0},
    year={2023}
}

References

I referred to these Github projects when I made this work: