Skip to content

Conversation

@princessamygdala
Copy link
Contributor

added two new social reinforcement learning models (1q3a1b and 1q4a1b) to rl.py

added model example implementation in the rl.ipynb notebook

modified plot_recovery() function in api.py

princessamygdala and others added 7 commits October 11, 2025 11:33
Enhanced the plot_recovery method to dynamically scale figure size and layout based on the number of parameters, ensuring square subplots and compact spacing. Updated plotting utilities to use constrained layout, improved marker sizing, annotation, and axis aspect handling for clearer and more consistent visualizations.
Updated the reinforcement learning example notebook to include a clearer titles. Reorganized introductory content for improved clarity.
princessamygdala and others added 11 commits October 20, 2025 15:45
rewards -> "outcomes"
fixed reward probabilities for self/other
made it more human readable
counterbalancing and fixed option pairs for simulate function
made sure rewards are not overwriting
made sure nblock number does not have to be a multiple of 6, 12, etc
adapted function call for 4a model from rewards --> "outcomes"
This reverts commit 13efef8.
Updated the default value of the njobs parameter from -1 to -2 in both EMModel and EMConfig classes
Replaces the deprecated set_constrained_layout_pads() with get_layout_engine().set() for adjusting subplot paddings, ensuring compatibility with newer matplotlib versions.
Refactored the bayes model API by renaming the 'simulate' and 'fit' functions to 'bayes_sim' and 'bayes_fit' respectively.
Renamed functions in pyem.models.glm.py for improved clarity and consistency: 'simulate' to 'glm_sim', 'fit' to 'glm_fit', 'simulate_decay' to 'glm_decay_sim', and 'fit_decay' to 'glm_decay_fit'.
Replaces deprecated or renamed simulation and fitting function imports in test files to match updated function names (e.g., rw1a1b_sim, rw2a1b_sim, bayes_sim, glm_sim, glm_decay_sim, etc.)
@shawnrhoads shawnrhoads changed the title Add social rl Adds social context RL models Oct 22, 2025
@shawnrhoads shawnrhoads requested a review from Copilot October 22, 2025 23:09
Copy link
Contributor

Copilot AI left a comment

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 two new social context reinforcement learning models (1q3a1b and 1q4a1b) to rl.py, provides example implementations in the rl.ipynb notebook, and modifies the plot_recovery() function in api.py to use a 3-column grid layout with improved spacing.

Key changes:

  • Added rw3a1b_sim/fit and rw4a1b_sim/fit functions for social RL models
  • Renamed existing simulation functions from *_simulate to *_sim for consistency
  • Updated plot_recovery() to use 3-column grid layout with constrained_layout

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pyem/models/rl.py Added two new social RL models (3α-1β and 4α-1β) and renamed simulation functions for consistency
pyem/api.py Modified plot_recovery() to use 3-column grid layout with improved spacing
pyem/utils/plotting.py Updated plot_scatter() with smaller default figure size and improved aspect ratio handling
pyem/core/em.py Changed default njobs from -1 to -2
pyem/models/bayes.py Renamed simulate/fit functions to bayes_sim/bayes_fit and removed unused import
tests/*.py Updated function names to match new *_sim naming convention
examples/glm.ipynb Updated figure size metadata to reflect new default

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shawnrhoads shawnrhoads merged commit 0221edd into shawnrhoads:main Oct 22, 2025
3 checks passed
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