Skip to content

dadmaan/aria

Repository files navigation

ARIA: Multi-Agent Music Generation with Reinforcement Learning

Docs CI Version

ARIA: Autonomous Reinforcement-learning with Intelligent Abstraction

ARIA is a modular RL framework for symbolic music generation with human-in-the-loop (HIL) adaptation.

Overview

ARIA combines three agents:

  • Perceiving Agent (GHSOM): clusters musical features and exposes structure.
  • Generative Agent (DQN family): selects cluster-level actions via Tianshou 2.x.
  • Human Agent: provides preference feedback for adaptation.

Supported algorithm variants include dqn, dueling_dqn, c51, and rainbow.

Quickstart

Docker (recommended)

Prerequisites:

  • Docker Engine 20.10+
  • Docker Compose v2+
  • NVIDIA Container Toolkit for GPU (optional)
# Build and start
cd docker && docker-compose build
docker-compose up -d

# Open shell
docker-compose exec music-generation-rl bash

# Verify GPU
python -c "import torch; print(torch.cuda.is_available())"

# Run training
python scripts/training/run_training.py --config configs/training.yaml

Notebook profile:

docker-compose --profile notebook up -d
# http://localhost:8888

Local installation

pip install -r requirements.txt

Core Workflows

Preprocessing

Use the unified pipeline to produce feature, reduction, GHSOM, and cluster-evaluation artifacts.

# Full pipeline
python scripts/preprocessing/run_preprocessing_pipeline.py \
    --config configs/preprocessing/full_pipeline.yaml

# Resume from existing stage outputs
python scripts/preprocessing/run_preprocessing_pipeline.py \
    --config configs/preprocessing/full_pipeline.yaml \
    --skip-feature-extraction \
    --features-artifact artifacts/features/raw/existing

python scripts/preprocessing/run_preprocessing_pipeline.py \
    --config configs/preprocessing/full_pipeline.yaml \
    --skip-feature-extraction \
    --skip-dimensionality-reduction \
    --reduced-artifact artifacts/features/reduced/existing

Main preprocessing configs live in configs/preprocessing/.

Typical output layout:

artifacts/preprocessing/<run_id>/
  extracted/
  reduced/reduced/
  ghsom/trained/
  evaluation/evaluated/
  pipeline_manifest.json
  pipeline_config.yaml

Training

# Default training
python scripts/training/run_training.py

# Custom config/overrides
python scripts/training/run_training.py \
    --config configs/training.yaml \
    --timesteps 200000 \
    --seed 42

# Benchmark variant config
python scripts/training/run_training.py \
    --config configs/benchmark/main/rainbow_cl.yaml

Inference

# Interactive HIL session
python scripts/inference/run_inference_pipeline.py hil \
    --checkpoint artifacts/training/run_xyz/checkpoints/final.pth \
    --config configs/inference/interactive.yaml

# Sequence analysis
python scripts/inference/run_inference_pipeline.py analyze \
    --sequences outputs/inference/sequences.json

# Preference-guided simulation
python scripts/inference/run_inference_pipeline.py simulate \
    --checkpoint path/to/checkpoint.pth \
    --inference-config configs/inference/simulation.yaml \
    --scenario calm_relaxation

Evaluation and Analysis

# MIR policy evaluation
python scripts/evaluation/run_mir_evaluation.py policy \
    --checkpoint <path/to/checkpoint.pth> \
    --config configs/inference/mir_evaluation.yaml \
    --strategy transition_smoothed \
    --n-episodes 100

# MIR post-hoc analysis
python scripts/evaluation/run_mir_evaluation_analysis.py \
    --input outputs/mir_evaluation/TIMESTAMP/policy_mir_comparison.json \
    --mode auto

# Policy diagnosis
python scripts/evaluation/run_policy_diagnosis.py \
    --config configs/inference/policy_diagnosis.yaml \
    --output outputs/diagnosis/ \
    --checkpoint <path/to/checkpoint.pth>

For MIR compare mode, checkpoint specs must use label:path with no spaces after :.

Configuration

Use split YAML configs by domain:

  • configs/training.yaml
  • configs/preprocessing/*.yaml
  • configs/inference/interactive.yaml
  • configs/inference/simulation.yaml
  • configs/inference/mir_evaluation.yaml
  • configs/inference/content_retrieval.yaml
  • configs/inference/policy_diagnosis.yaml
  • configs/benchmark/** and configs/ablations/**

Precedence: CLI args > YAML config > code defaults.

Project Structure

src/                 Core library (agents, envs, training, inference, evaluation)
scripts/             User-facing CLIs
configs/             YAML config families
artifacts/           Generated preprocessing/training artifacts
test/                Unit and integration tests
docker/              Container setup

Development

python -m pytest
python -m pytest --cov=src --cov-report=html
ruff check src/ scripts/
ruff format src/ scripts/
pre-commit run --all-files

References

License

This project is licensed under the MIT License. See LICENSE.

Contributing

Please follow CONTRIBUTING.md for commit message conventions and workflow guidance.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors