This GitHub repository contains scripts designed to explore the impact of synaptic upscaling on the chaotic dynamics of spontaneous neural activity within recurrent neural networks (RNNs), utilizing a rate-based neuron model.
heterogeneous_synaptic_homeostasis
├── data
│ └── data_curation.zip
│ └── data_curation.pickle
├── figures
│ └── results.pdf
├── python_scripts
│ ├── synaptic_upscaling_chaos_module.py
│ ├── parallel_simulations.py
│ ├── datacuration.py
│ ├── plot_final_figure.py
│ └── test.py
├── job.sh
├── bash_function.sh
├── LICENSE
└── README.md
The _job.sh_ script is an executable that submits simulation tasks. To execute the _job.sh_ script, use the following commands in the terminal:
$ chmod +x job.sh
$ ./job.sh
Briefly, the script is organized into blocks, each corresponding to specific simulations. The first block corresponds to the simulations of five sessions, each with a unique connectivity matrix in the RNN. Within each session, a randomly generated connection matrix was used. Each session included 8 episodes, corresponding to 8 different synaptic upscaling factors. To facilitate the simulation speed, the Message Passing Interface (MPI) is utelized. In particular, mpi4py is employed to utelizes the 8 cpus, distributing the 8 episodes across 8 cpus. The second block corresponds to data curation, and finally, the third block corresponds to the plots of the results.
To summarize, the script is segmented into blocks, each allocated for specific tasks. The opening block encompasses simulations across five distinct sessions, each characterized by a unique connectivity matrix within the RNN. In each session, a connection matrix is randomly generated. These sessions are comprised of eight episodes, reflecting different levels of synaptic upscaling in the RNN. To boost simulation performance, mpi4py is employed to fully utilize all 8 CPUs, distributing the episodes equitably among them. Subsequently, there is a block dedicated to data curation, and the concluding block is tasked with creating visual representations of the outcomes.
The Python scripts are located within the python_scripts directory and include:
- synaptic_upscaling_chaos_module.py
- parallel_simulations.py
- datacuration.py
- plot_final_figure.py
- test.py
synaptic_upscaling_chaos_module.py: This script is designed to model the behavior of a Recurrent Rate Neural Network (RRNN), featuring
The synaptic strengths, represented by non-zero elements in the connectivity matrix, are generated through independent sampling (across sessions) from Gaussian distributions. These distributions are characterized by a mean of zero and variances that are inversely proportional to the product of
Python requirements:
- numpy
parallel_simulations.py: This script is designed to numerically integrate a Recurrent Neural Network (RNN) under various configurations, focusing on the impact of a synaptic upscaling factor (
- SESSION variable: Utilizes the SESSION environment variable to manage different connectivity matrices, allowing for comprehensive analysis across multiple configurations.
-
Episodic Trials: Each session consists of 8 episodes, with the synaptic upscaling factor (
$g$ ) varying from 1 to 21 increments of 3 across episodes. This design enables a thorough examination of how different synaptic upscaling values affect the network's behavior. -
Network Initialization: Each episode contains 20 trials, with each trial initializing the network with a unique configuration. The firing rate vector (r) is initialized with uniform random values between
$\[-1, 1\]$ , and the network simulation runs for 7 seconds per trial. -
Chaotic Activity Evaluation: To assess the presence of chaotic activity, the script employs the Lyapunov exponent, a metric that measures the system's sensitivity to initial conditions. Variations of
$10^{-4}$ are introduced in the initial conditions of each neuron across trials within episodes and sessions to observe the divergence of trajectories over time, indicative of chaotic behavior. - Parallel Processing: Leverages the mpi4py library to distribute the computation of 8 different synaptic upscalings across 8 CPUs, optimizing computational efficiency and scalability.
Python requirements:
- synaptic_upscaling_chaos_module.py
- numpy
- mpi4py
- pickle
- os
datacuration.py: This script is designed for data curation and analysis, specifically targeting the computation of the Lyapunov exponent for RNNs. It stores the spontaneous dynamics of a single neuron across different synaptic upscaling factors and the initial condition variations, providing insights into the network's behavior under various conditions.
-
Dynamic Analysis Across Sessions: Captures the network's spontaneous dynamics for a single neuron in an example session, considering different synaptic upscaling factors and slight variations in itial conditions (by
$10^{-4}$ ). - Lyapunov Exponent Calculation: Assesses the Lyapunov exponent across various synaptic upscaling factors for the dynamics of neighboring trajectories in the phase space, offering a quantitative measure of chaos in the system.
- Trajectory Divergence Analysis: Computes the divergence of neighboring trajectories over time, leveraging the following formula to quantify the level of chaos:
Here,
Where
Python requirements:
- numpy
- pickle
plot_final_figure: This script is aimed at plotting the results. It also visualizes the graph representation of an exemplary RNN. Leveraging the powerful NetworkX library in Python, it provides a straightforward way to generate and display the structural of the experimental design. It creates a graphical representation of an RNN, showcasing the connections and nodes, and how synaptic upscaling affects the network structure in an intuitive format.
Python requirements:
- numpy
- pickle
- matplotlib
- seaborn
- networkx
- cmasher
test.py: This script is designed to assess the feasibility and effectiveness of conducting parallel simulations using the MPI.
Python requirements:
- numpy
- mpi4py
to run the test.py script, propmt the following command from the repository directory:
$ mpirun -np 8 --oversubscribe python3 ./python_scripts/test.py
This directory includes a zip file containing the python dictionary of the processed data in the format of pickle (data_curation.pickle).
This directory contains a PDF file as results.pdf showcasing the results of simulations
Thank you for considering contributing to our project! We welcome contributions from the community to help improve our project and make it even better. To ensure a smooth contribution process, please follow these guidelines:
-
Fork the Repository: Fork our repository to your GitHub account and clone it to your local machine.
-
Branching Strategy: Create a new branch for your contribution. Use a descriptive branch name that reflects the purpose of your changes.
-
Code Style: Follow our coding standards and style guidelines. Make sure your code adheres to the existing conventions to maintain consistency across the project.
-
Pull Request Process: Before starting work, check the issue tracker to see if your contribution aligns with any existing issues or feature requests. Create a new branch for your contribution and make your changes. Commit your changes with clear and descriptive messages explaining the purpose of each commit. Once you are ready to submit your changes, push your branch to your forked repository. Submit a pull request to the main repository's develop branch. Provide a detailed description of your changes and reference any relevant issues or pull requests.
-
Code Review: Expect feedback and review from our maintainers or contributors. Address any comments or suggestions provided during the review process.
-
Testing: Ensure that your contribution is properly tested. Write unit tests or integration tests as necessary to validate your changes. Make sure all tests pass before submitting your pull request.
-
Documentation: Update the project's documentation to reflect your changes. Include any necessary documentation updates, such as code comments, README modifications, or user guides.
-
License Agreement: By contributing to our project, you agree to license your contributions under the terms of the project's license (GNU General Public License v3.0).
-
Be Respectful: Respect the opinions and efforts of other contributors. Maintain a positive and collaborative attitude throughout the contribution process.
We appreciate your contributions and look forward to working with you to improve our project! If you have any questions or need further assistance, please don't hesitate to reach out to us.
- Author: Farhad Razi
This project is licensed under the GNU General Public License v3.0
- Contact information: email