Skip to content

Quickstart

Two ways in, five minutes each. Both are excerpted here and read line-by-line on their own tutorial pages — every number below is produced by executing this page.

Run the demo

skyfall-crl demo --traces demo-run

One command trains a policy on a world whose gravity shifts underneath it, scores the run against the continual-learning protocol, and explains what it found:

  window 1  calm         mean episode length   97.5
  ...
  Metric                     segment
  ----------------------------------
  Per-configuration reward  0.804167
  Adaptation speed                 1
  Forgetting                 -0.2625
  Stability (variance)      0.926222
  ...

Forgetting came out negative — the policy handled the returning conditions better than the first time, which is backward transfer, not forgetting. L0 — Five minutes reads the complete output, all thirteen rows.

The same machinery, in twenty lines

from skyfall_crl.train import ExperimentConfig, run_experiment

CONFIG = """
env:       {id: CartPole-v1}
algorithm: {name: discrete_hill_climbing}
rollout:   {window_steps: 200, total_steps: 1200, auto_reset: true}
regime:
  provider: scheduled
  params:
    schedule:
      regimes:
        - {regime_id: calm,       duration_steps: 400}
        - {regime_id: windy,      duration_steps: 400}
        - {regime_id: calm_again, alias_of: calm, duration_steps: 400}
run: {name: quickstart, seed: 0, trace_path: traces.jsonl}
"""

result = run_experiment(ExperimentConfig.from_yaml(CONFIG))
print(f"{result.steps} steps, {len(result.window_metrics)} windows, "
      f"configurations {', '.join(result.regimes)} -> {result.trace_path}")
1200 steps, 6 windows, configurations calm, windy, calm_again -> traces.jsonl

Then score the trace it wrote — skyfall-crl eval --traces traces.jsonl — and read L1 — A first run in code, whose whole point is that this particular table comes out deliberately disappointing, and why that is the measurement working.

Where next

The tutorial ladder climbs from here in strictly increasing scale: your own environment (L2), an instrumented one with composed rewards (L3), a cross-family comparison (L4), and a complete experiment ending in a served policy (L5). If you have a live MORPHEUS deployment, L6 runs every layer at once.