Git Product home page Git Product logo

hcprediction's Introduction

Scripts used to reproduce figures in: https://www.biorxiv.org/content/10.1101/2022.05.19.492731v2

NeuralEvidence (Fig.2)

Network training and analysis

  • Build a python environment:
    conda env export > environment.yml

Simulation of predictive network (Fig.3)

  1. Train the models:
  • Non-predictive model
    python Main_clean.py --input data/SeqN1T100.pth.tar --ae 1 -n 1 --fixo 3 --fixi 3 --rnn_act relu --ac_output sigmoid --savename Elman_SGD/Sigmoid/SeqN1T100_relu_fixio3
  • Predictive model
    python Main_clean.py --input data/SeqN1T100.pth.tar --ae 1 -n 1 --fixi 3 --fixo 3 --pred 1 --rnn_act relu --ac_output sigmoid --savename Elman_SGD/Sigmoid/SeqN1T100_pred_relu_fixio3
  1. Convert python output to *.mat
    python py2mat_ext.py

  2. Plot the figure:
    MATLAB Figure3.m

Simulation of CA1 and CA3 place cells (Fig.4)

  1. Train the models: ./Figure4_run.sh

  2. Plot the figures:
    python Figure4.py

Localization (Fig.5)

  1. Traj_Generate.m: simulation code for straight line exploration (Main reference: https://www.pnas.org/doi/10.1073/pnas.2018422118)

  2. Localization_clean.py: generate model input from simulated trajectories.

  3. Train the model:

  • Non-predictive model
    for i in {1..10} do python Main_s4.py --epochs 30000 --batch-size 5 --hidden-n 500 --net ElmanRNN --act sigmoid --rnn_act relu --gpu 1 --Hregularized 5.0 --clip 10 --ae 1 --input data/InputNs50_SeqN100_StraightTraj_Marcus_v2.pth.tar --savename Elman_SGD/GridInput/BatchTraining/PhysicalInput_v2/repeats/InputNs50_SeqN100_Marcus_HN500_H5.0_rep$i done

  • Predictive model
    for i in {1..10} do python Main_s4.py --epochs 30000 --batch-size 5 --hidden-n 500 --net ElmanRNN_tp1 --pred 1 --act sigmoid --rnn_act relu --gpu 4 --Hregularized 5.0 --clip 10 --ae 1 --input data/InputNs50_SeqN100_StraightTraj_Marcus_v2.pth.tar --savename Elman_SGD/GridInput/BatchTraining/PhysicalInput_v2/repeats/InputNs50_SeqN100_Marcus_HN500_H5.0_tp1_rep$i done

  1. Plot the figure: python Figure5.py

MNIST sequence learning (Fig.6)

  1. Generate MNIST inputs:
    python Figure6_InputPrep.py

  2. Train models:
    python Main.py -n 68 --input MNIST_68PC_SeqN100_Ns5.pth.tar --lr 0.0002 --pred 1 --partial 0.2 --ac_output tanh --Hregularized 1 --epochs 10000 -p 100 --savename Elman_SGD/predloss/MNIST_68PC_SeqN100_Ns5_partial

  3. Plot the figure:
    python Figure6.py

Local RNN training (Fig.7)

  1. Train models:
    python Main_local.py --n 68 --hidden_n 100 --inputfile 'data/data_pca.pkl' --savename 'mnist_local' --learning_alg 'local' --epochs 500001 --lr 0.001 --t 10

  2. Plot the figure:
    python Figure7.py

hcprediction's People

Contributors

yschen13 avatar

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.