Skip to content

PID preliminary analysis on sinusoid-trained RNN#35

Merged
jgendra merged 3 commits into
mainfrom
jgendra
Jun 14, 2026
Merged

PID preliminary analysis on sinusoid-trained RNN#35
jgendra merged 3 commits into
mainfrom
jgendra

Conversation

@jgendra

@jgendra jgendra commented Jun 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 14, 2026 15:54
@jgendra
jgendra merged commit 2597d5f into main Jun 14, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a preliminary pipeline for computing and plotting Gaussian analytic PID results from a sinusoid-trained (Elman) RNN, while updating the training/evaluation script to report R² and saving outputs under src/analysis/results/.

Changes:

  • Renames the RNN class to ElmanRNN and removes the Jacobian-tracking method from the src/analysis implementation.
  • Updates main.py to train the sinusoid RNN with a simple LR schedule, track R², save the trained model/hidden states, and generate training + rollout figures.
  • Adds scripts to compute PID for the sinusoid-trained RNN and to plot PID bar figures; removes an unused analysis utils.py module.

Reviewed changes

Copilot reviewed 6 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/analysis/utils.py Removes the (now unused) spectrum-error utility module from src/analysis.
src/analysis/RNN.py Renames the model to ElmanRNN and removes calculate_jacobian.
src/analysis/main.py Trains/evaluates the sinusoid RNN, tracks R², saves artifacts, and generates figures.
src/analysis/compute_pid_sinusoid.py Runs a multi-trial sinusoid ensemble through the trained RNN and computes/saves PID results.
src/analysis/PID_figures.py Loads saved PID results and plots bar charts with error bars.
src/analysis/gaussian_pid.py Documentation wording/formatting adjustments for the Gaussian PID implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +18
labels = ['Redundancy', 'Unique1', 'Unique2', 'Synergy']
values = [out['redundancy'], out['unique1'], out['unique2'], out['synergy']]
stds = [out['redundancy_std'], out['unique1_std'], out['unique2_std'], out['synergy_std']]
total = out['mi_joint']
Comment on lines 16 to 18
"PID at the last timestep" we must build an ensemble. We do this exactly the way
the real NeuroGym project will: we run the trained RNN over many *trials* and use
the our NeuroGym project will: we run the trained RNN over many "trials" and use
the trial dimension as the sample/ensemble axis. Each trial is the same sinusoid
HarrisIp pushed a commit that referenced this pull request Jul 1, 2026
PID preliminary analysis on sinusoid-trained RNN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants