Skip to content

Experiment Abstraction through config settings#1

Open
HashirA123 wants to merge 3 commits intocharmlab:mainfrom
HashirA123:feature/experiment_abstraction
Open

Experiment Abstraction through config settings#1
HashirA123 wants to merge 3 commits intocharmlab:mainfrom
HashirA123:feature/experiment_abstraction

Conversation

@HashirA123
Copy link
Collaborator

@HashirA123 HashirA123 commented Feb 26, 2026

This pull request focuses on modularizing the configuration system, standardizing naming conventions, and improving extensibility for experiments. The changes enable experiment-level configuration overrides, introduce factory patterns for method and evaluation instantiation, and rename core classes for clarity.

Configuration and Experiment Orchestration

  • Added config_utils.py with utilities for loading YAML configs and recursively merging experiment-level overrides into layer configs.
  • Introduced a top-level experiment configuration YAML (experiments/experiment_roar_mlp_config.yml) that controls all aspects of an experiment, including data, model, method, and evaluation settings and their overrides.
  • Refactored experiment.py to orchestrate the full pipeline: loading configs, merging overrides, instantiating data/model/method/evaluation objects, selecting factuals, running counterfactual generation, and aggregating evaluation results.

Class and File Renaming for Clarity

  • Renamed DataModule to DataObject and EvaluationModule to EvaluationObject throughout the codebase, updating all imports and usages for consistency.
  • Updated method and model classes to use the new naming conventions, including ModelObject and related references.

Extensibility via Factory Patterns

  • Added evaluation_factory.py with a registry and factory functions for instantiating evaluation metrics from config, supporting easy addition of new metrics via decorators.

Layer Configuration and Overrides

  • Modified layer constructors (DataObject, ModelObject, etc.) to accept merged config dictionaries, enabling experiment-level overrides without directly editing layer config files.

Miscellaneous Improvements

  • Updated ROAR method config with new default values for hyperparameters.

This better reflects their roles as objects better.
Is also easier on the tongue.
Does so without needing the user to touch the code,
this repo still needs alot of error handling incase bad
configs are given.
@HashirA123 HashirA123 marked this pull request as ready for review February 27, 2026 23: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