Skip to main content

Backend-agnostic adapter library for physical simulation ML

Project description

PhysLink

License: MIT CI Docs PyPI Python arXiv

Open In Colab

Quick Start →   |   Evaluate for your lab →   |   For Domain Scientists →


PhysLink bridges physical simulators and deep RL adapters in one pip install.

Plug your robot trajectories into DreamerV3 (and future backends) without writing boilerplate space definitions, checkpoint logic, or compliance checks. PhysLink handles the plumbing — you keep the science.

Why PhysLink

Without PhysLink With PhysLink
Hand-write observation/action space mappings per framework ObservationSpace.from_proprioception(joints=7)
Debug silent OOM on Colab at step 8 000 physlink.doctor() catches it before you start
Lose 3h of T4 training on session disconnect Auto-checkpoint every N steps, resume on reconnect
Manually verify energy conservation after adaptation register_invariant + compliance_report()
Stare at loss curves to diagnose model drift Triptych GIF — Imagination / Real / Difference in one call

Install

pip install physlink

Works on Google Colab out of the box. No CUDA required for diagnostics and space definitions.

Quick example

import physlink

# 1. Verify your environment (< 15 s)
physlink.doctor()

# 2. Define spaces from your robot config
obs = physlink.ObservationSpace.from_proprioception(joints=7, include_velocity=True)
act = physlink.ActionSpace.continuous(dims=7, bounds=(-1.0, 1.0))

# 3. Adapt
adapter = physlink.DreamerV3Adapter(obs, act)
adapter.fit(trajectories, steps=10_000)

# 4. Validate physics compliance
physlink.register_invariant(adapter, "energy", fn=energy_fn, tolerance=0.05)
report = adapter.compliance_report()
report.plot()

# 5. Visualise
adapter.visualize(trajectories)   # → triptych GIF
adapter.export("./run-01/")

Documentation

Full docs at Denis-hamon.github.io/physlink — includes API reference, lab adoption guide, and domain-scientist quickstart.

Status

v0.1.x — public API stable across minor versions (see CHANGELOG).
test-cpu CI passes on every PR. GPU benchmarks run on release tags.

Contributing

See CONTRIBUTING.md. Issues and PRs welcome — use the provided templates.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

physlink-0.1.2.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

physlink-0.1.2-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page