Skip to content

Fix IQL configuration and CQL/DT dependency issues in ablation studies#14

Closed
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix-iql-cql-ablation-13904231114388625638
Closed

Fix IQL configuration and CQL/DT dependency issues in ablation studies#14
google-labs-jules[bot] wants to merge 1 commit intomainfrom
fix-iql-cql-ablation-13904231114388625638

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

Fixes critical issues preventing ablation studies for IQL, CQL, and DT models from running.

  1. IQL Initialization: run_experiment.py now automatically infers is_discrete, act_dim, and state_dim from the Gym environment if these parameters are missing from the configuration. This resolves the AttributeError: 'AttrDict' object has no attribute 'is_discrete' error.
  2. Missing norse Dependency: src/models/__init__.py was modified to wrap the import of SpikingSelfAttention in a try-except ImportError block. This allows non-spiking models (CQL, DT, IQL) to run in environments where the norse library (required only for SNNs) is not installed.
  3. Loss Logging: The training loop in run_experiment.py was updated to check if loss is a PyTorch tensor before calling .item(), preventing AttributeError: 'float' object has no attribute 'item' when the loss is already a float.

These changes ensure the ablation study pipeline is robust and functional across different models and environments.


PR created automatically by Jules for task 13904231114388625638 started by @Vishal-sys-code

- Infer `is_discrete` and `act_dim` from the environment in `run_experiment.py` to fix IQL initialization when dataset metadata is incomplete.
- Conditionally import `SpikingSelfAttention` in `src/models/__init__.py` to prevent crashes in non-spiking models (CQL, DT) when `norse` is not installed.
- Safely handle loss logging in `run_experiment.py` to support both tensor and float loss values.
- Verified fixes by running IQL and CQL ablation experiments on CartPole-v1.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@Vishal-sys-code Vishal-sys-code marked this pull request as ready for review January 2, 2026 03:27
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.

1 participant