Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
33d2f71
remove authors from readme
jgendra Jun 5, 2026
b6d0aa1
Added basic RNN structure, super simple analysis (PCA instead of Mant…
Sidlertime Jun 8, 2026
d9efb74
Add files via upload
HarrisIp Jun 8, 2026
2a70a1b
Restructured main branch directories (updated readme)
jgendra Jun 13, 2026
d98ec19
Restructured main, track empty folders
jgendra Jun 13, 2026
376e83e
updated requirements cuda 12.1, added pid algorithm draft
jgendra Jun 13, 2026
84cf33a
PID algorithm, sinusoid RNN, PID sinusoid results
jgendra Jun 14, 2026
b951036
PID sinusoid 10 vs 100 RNN bar plots
jgendra Jun 14, 2026
b419cb5
Increase label fontsize PID figures
jgendra Jun 14, 2026
0351f01
Merge pull request #35 from jgendra/jgendra
jgendra Jun 14, 2026
96bb8a5
Merge branch 'main' into jp
Sidlertime Jun 14, 2026
3685be7
Update module and environment.yml to reflect changes of requirements.txt
Sidlertime Jun 15, 2026
2a5c9fc
Add Neurogym Data Wrapper
Sidlertime Jun 15, 2026
e29525a
Apply Gaussian PID to Elman and CT RNNs of different sizes (20 vs 80)…
Sidlertime Jun 15, 2026
4eb669c
Add dataset generation pipeline and local data files
HarrisIp Jun 16, 2026
bc39570
data generation directory
HarrisIp Jun 18, 2026
2cfbca4
Merge branch 'Harris' into jp
Sidlertime Jun 19, 2026
1b5cc16
Updated neurogym version, removed datasets from tracking (determinist…
Sidlertime Jun 20, 2026
648e729
Fixed version conflicts, moved to new datasets, needs some more testing
Sidlertime Jun 20, 2026
7789801
Update new Datageneration pipeline
Sidlertime Jun 22, 2026
5a8bfe7
Multiple training runs, correct pid visualization now
Sidlertime Jun 22, 2026
a3ae456
compare size of RNN
HarrisIp Jun 24, 2026
b7ad23b
compare size of RNN
HarrisIp Jun 24, 2026
b12ddc1
Save size comparison PID work
HarrisIp Jun 24, 2026
5ff4035
Merge origin/jp into harris
HarrisIp Jun 24, 2026
2e976df
update sixe comparison in context task
HarrisIp Jun 26, 2026
cf26191
include a script (ctrnn_pid_both_tasks.py) that can load dataset trai…
HarrisIp Jun 28, 2026
6342565
update mante config and analysis notebooks
HarrisIp Jul 1, 2026
be113b8
check loss for notbook 05
HarrisIp Jul 1, 2026
f97fa7f
separating size comparison out
HarrisIp Jul 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Taken from https://github.com/github/gitignore
### Manual additions
# Generated Data
*.npz
*.json

# Model weights
weights/

### Taken from https://github.com/github/gitignore

### Python
# Byte-compiled / optimized / DLL files
Expand Down
17 changes: 3 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,12 @@ and **Bonferroni** correction for planned comparisons.
NeuroAI-Project13/
├── README.md
├── environment.yml # pinned conda environment
├── configs/ # experiment configs (task × condition × seed)
├── src/
│ ├── models/ # CTRNN definition + Euler integration
│ ├── tasks/ # NeuroGym task wrappers (dt=20 ms)
│ ├── training/ # training loop, loss functions, BPTT
│ ├── analysis/ # PID / ΦID / MI / Fisher pipelines
│ └── stats/ # permutation tests, bootstrap, effect sizes
├── notebooks/ # exploratory analysis + figure generation
├── results/ # checkpoints, saved activations, metric outputs
│ └── analysis/ # PID / ΦID / MI / Fisher pipelines
├── notebooks/ # exploratory analysis + throwaway/example files
├── results/ # saved model weights/activations, metric outputs
├── figures/ # final figures
└── docs/ # technical note, references
```
Expand Down Expand Up @@ -148,14 +145,6 @@ python -m src.stats.run_tests --metrics results/metrics/
Planning and progress are tracked on the repo's **Projects** tab (Roadmap / Board / Table views).
Key dates: final roadmap **8 June**, midway presentation **17 June**, final presentation **15 July 2026**.

## Team

Group project (3 members):

- Jan Casas Gendra
- Jean-Pasqual Sindermann
- Wang Chak Ip

## References

- Williams & Beer (2010), *Nonnegative Decomposition of Multivariate Information* — [arXiv:1004.2515](https://doi.org/10.48550/arXiv.1004.2515)
Expand Down
17 changes: 17 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: neuroai-project13
channels:
- nvidia
- pytorch
- conda-forge
- defaults
dependencies:
- python=3.11
- pytorch=2.4.1
- pytorch-cuda=12.1
- pip:
- numpy
- scipy
- matplotlib
- seaborn
- neurogym==2.3.1
- jupyter
Empty file added figures/.gitkeep
Empty file.
Binary file added figures/learning_curves/context/CTRNN_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added figures/learning_curves/perceptual/CTRNN_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
317 changes: 317 additions & 0 deletions notebooks/01_poc_training.ipynb

Large diffs are not rendered by default.

252 changes: 252 additions & 0 deletions notebooks/02_poc_analysis.ipynb

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions notebooks/03_neurogym_tour.ipynb

Large diffs are not rendered by default.

666 changes: 666 additions & 0 deletions notebooks/04_minimal_product.ipynb

Large diffs are not rendered by default.

668 changes: 668 additions & 0 deletions notebooks/05_Full_train_pipeline.ipynb

Large diffs are not rendered by default.

Empty file.
Binary file not shown.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from example_rnn.dyn_rnn.dynRNN import DynRNN
from notebooks.example_rnn.dyn_rnn.dynRNN import DynRNN

# Define task directory
dir = "dynrnn/"
dir = "example_rnn/dyn_rnn/"

# hyperparameters
BATCH_SIZE = 1 # not really used here, since we train on a single trajectory
EPOCHS = 1000
EPOCHS = 100
LEARNING_RATE = 1e-3

# Choose dynamical system
system = 'Lorenz' # 'VanDerPol' or 'Lorenz'
system = 'VanDerPol' # 'VanDerPol' or 'Lorenz'

if __name__ == "__main__":

y_true = torch.load(f'{dir}y_{system}.pt', weights_only=True) # Size (300, 2) or (300, 3)
# print(y_true.shape)
print(y_true.shape)

n_timesteps, dim = y_true.shape

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using device: {device}")
y_true = y_true.to(device)

# Create RNN
Expand Down Expand Up @@ -85,8 +86,8 @@
)

# Save trained RNN
torch.save(model.state_dict(), f"{dir}RNN_{system}.pt")
print(f"Trained RNN saved to {dir}RNN_{system}.pt")
torch.save(model.state_dict(), f"{dir}RNN_{system}_{EPOCHS}.pt")
print(f"Trained RNN saved to {dir}RNN_{system}_{EPOCHS}.pt")


# ===== EVALUATION: AUTOREGRESSIVE ROLLOUT =====
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from example_rnn.true_rnn.trueRNN import TrueRNN
from notebooks.example_rnn.true_rnn.trueRNN import TrueRNN

# Define task directory
dir = "true_rnn/"
dir = "example_rnn/true_rnn/"

# hyperparameters
BATCH_SIZE = 1 # not really used here, since we train on a single trajectory
Expand Down
Binary file added notebooks/poc_hidden_states.npy
Binary file not shown.
224 changes: 224 additions & 0 deletions notebooks/recreateRNN.ipynb

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "neuroai-project13"
version = "0.2.0"
description = "Information Decomposition in Task-Trained RNNs"
requires-python = ">=3.11"
dependencies = [
"torch==2.4.1+cu121",
"numpy",
"scipy",
"matplotlib",
"seaborn",
"neurogym==2.3.1"
]
Comment on lines +10 to +17

[tool.setuptools.packages.find]
where = ["."]
include = ["src*"]
17 changes: 14 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
matplotlib==3.9.2; python_version >= '3.12'
numpy==2.1.3; python_version >= '3.12'
torch==2.5.1; python_version >= '3.12'
# Core ML — CUDA 12.1 build, compatible with all team GPUs + Python 3.11
torch==2.3.1; python_version >= '3.11'
--extra-index-url https://download.pytorch.org/whl/cu121

# Numerics & stats
numpy==1.26.4; python_version >= '3.11'
scipy==1.13.1; python_version >= '3.11'

# Visualization
matplotlib==3.9.2; python_version >= '3.11'
seaborn==0.13.2; python_version >= '3.11'

# NeuroGym tasks
neurogym==2.3.1; python_version >= '3.11'
Empty file.
Binary file added results/model_activations/context/CTRNN_01.npy
Binary file not shown.
Binary file added results/model_activations/perceptual/CTRNN_01.npy
Binary file not shown.
Empty file added results/model_weights/.gitkeep
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added results/model_weights/context/CTRNN_01.pt
Binary file not shown.
Binary file added results/model_weights/perceptual/CTRNN_01.pt
Binary file not shown.
Empty file added results/pid_outputs/.gitkeep
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading