{"id":50673840,"url":"https://github.com/jaintle/teach-once","last_synced_at":"2026-06-08T14:02:19.182Z","repository":{"id":358222556,"uuid":"1237111444","full_name":"jaintle/teach-once","owner":"jaintle","description":"Show a robot once. TP-GPT generalizes it everywhere. · Interactive demo + full paper reproduction (Franzese et al. 2024)","archived":false,"fork":false,"pushed_at":"2026-05-16T10:07:35.000Z","size":131271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T11:29:42.116Z","etag":null,"topics":["gaussian-processes","imitation-learning","policy-generalization","robot-learning"],"latest_commit_sha":null,"homepage":"https://jaintle.github.io/teach-once/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaintle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T22:14:20.000Z","updated_at":"2026-05-16T10:07:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jaintle/teach-once","commit_stats":null,"previous_names":["jaintle/teach-once"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/jaintle/teach-once","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaintle%2Fteach-once","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaintle%2Fteach-once/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaintle%2Fteach-once/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaintle%2Fteach-once/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaintle","download_url":"https://codeload.github.com/jaintle/teach-once/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaintle%2Fteach-once/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34065354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gaussian-processes","imitation-learning","policy-generalization","robot-learning"],"created_at":"2026-06-08T14:02:18.612Z","updated_at":"2026-06-08T14:02:19.177Z","avatar_url":"https://github.com/jaintle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# teach-once\n\n**Show a robot a task once. TP-GPT generalizes it everywhere.**\n\n\u003cimg src=\"docs/assets/static/image.png\" alt=\"TP-GPT interactive demo — Franka arm generalizing pick-and-place from a single demonstration\" width=\"720\"\u003e\n\n[![Live Demo](https://img.shields.io/badge/demo-live-00d4ff?style=flat-square\u0026logo=googlechrome\u0026logoColor=white)](https://jaintle.github.io/teach-once/)\n[![Paper](https://img.shields.io/badge/arXiv-2404.13458-b31b1b?style=flat-square)](https://arxiv.org/abs/2404.13458)\n[![Paper Video](https://img.shields.io/badge/video-YouTube-ff0000?style=flat-square\u0026logo=youtube)](https://youtu.be/bE6uOnAQBLo)\n[![Original Code](https://img.shields.io/badge/original-code-333?style=flat-square\u0026logo=github)](https://github.com/franzesegiovanni/policy_transportation)\n[![Python](https://img.shields.io/badge/python-3.11-3776ab?style=flat-square\u0026logo=python\u0026logoColor=white)](https://www.python.org/)\n[![License](https://img.shields.io/badge/license-MIT-green?style=flat-square)](LICENSE)\n[![Tests](https://img.shields.io/badge/tests-105%20passing-success?style=flat-square)](tests/)\n\n\u003cbr\u003e\n\nFaithful reproduction of **TP-GPT** (Task-Parameterized Gaussian\nProcess Transportation) from Franzese et al. 2024, with a fully\ninteractive browser demo — no installation required.\n\n[**Try the live demo →**](https://jaintle.github.io/teach-once/)\n\n![TP-GPT highlight reel](reports/figures/final_highlight.gif)\n\n\u003c/div\u003e\n\n---\n\n## What is TP-GPT?\n\nTP-GPT learns a robot policy from a **single demonstration**. When the scene\nchanges — objects move, surfaces tilt, arm poses shift — it transports the\noriginal policy to the new configuration using Gaussian Process regression,\nwithout any retraining.\nDemo on flat surface  →  TP-GPT  →  Policy on curved surface\nOne pick-place path   →  TP-GPT  →  New object/shelf positions\nOne arm-tracing path  →  TP-GPT  →  New arm configuration\n\n---\n\n## Interactive demo\n\nTry it live at **https://jaintle.github.io/teach-once/**\n\nThree interactive modes:\n\n| Mode | What you do | What TP-GPT does |\n|------|------------|-----------------|\n| **Reshelving** | Drag the box and shelf to new positions | Transports the pick-place demo to the new layout |\n| **Cleaning** | Draw a freehand path on the table (or use default raster scan), then select a surface shape | Transports your drawn path to the deformed surface |\n| **Arm-pose** | Drag shoulder/elbow/wrist/hand spheres | Transports the tracing path to the new arm config |\n\n---\n\n## Portfolio animations (Franka Panda)\n\n![highlight reel](reports/figures/final_highlight.gif)\n\n| Task | Animation | What it shows |\n|------|-----------|--------------|\n| Reshelving | ![reshelving](reports/figures/final_reshelving.gif) | Arm picks box from table, carries to shelf |\n| Cleaning | ![cleaning](reports/figures/final_cleaning.gif) | Arm sweeps across transported surface path |\n| Arm-pose | ![armpose](reports/figures/final_armpose.gif) | Arm traces through all 4 keypoints |\n\n\u003e Franka Panda arm with kinematic IK control. TP-GPT plans EE trajectories;\n\u003e IK converts to joint angles. See `reports/REPORT.md` for honest discussion\n\u003e of open-loop vs impedance control.\n\n---\n\n## Paper reproduction status\n\n| Paper Section | Content | Status |\n|---|---|---|\n| Sec. III-B | GP regression (exact + SVGP) | ✅ Full |\n| Sec. III-A | DS learning from demonstrations | ✅ Full |\n| Sec. III-E | Linear transport via SVD (Eqs. 8–11) | ✅ Full |\n| Sec. III-E | Non-linear GP transportation (Eq. 12) | ✅ Full |\n| Sec. III-F | Velocity transport via Jacobian (Eq. 13) | ✅ Full |\n| Sec. III-G | Orientation + stiffness transport (Eqs. 14–15) | ✅ Full |\n| Sec. III-H | Uncertainty propagation (Eqs. 16–18) | ✅ Full |\n| Sec. IV-A | 2D surface cleaning comparison + Fig. 7 | ✅ Full |\n| Sec. IV-B | Multi-frame benchmark + Figs. 8–10 | ⚠️ Simplified |\n| Sec. IV-B | Multi-source single-target + Fig. 11 | ✅ Full |\n| Sec. V-A | Reshelving (3D MuJoCo kinematic analog) | ✅ Analog |\n| Sec. V-B | Dressing → arm-pose following (3D analog) | ✅ Analog |\n| Sec. V-C | Surface cleaning (3D SVGP, Figs. 15–16 analog) | ✅ Analog |\n\n**Simplifications:**\n- Sec. IV-B: HMM-LQR replaced by greedy GMM rollout.\n- Sec. V: Real Franka replaced by MuJoCo kinematic IK.\n  No cloth simulation. Force via Hooke's law proxy.\n  Cloud pairing via nearest-neighbour (not optimal transport).\n\n---\n\n## Setup\n\nRequires **Python 3.11**.\n\n```bash\ngit clone https://github.com/jaintle/teach-once.git\ncd teach-once\npython3.11 -m venv .venv\nsource .venv/bin/activate      # Windows: .venv\\Scripts\\activate\npip install -e \".[dev]\"\n```\n\n---\n\n## Reproduce all 2D figures (Secs. III–IV)\n\n```bash\n# Phase 1 — GP regression quality check\npython scripts/smoke_phase1.py\n# → reports/figures/phase1_gp_demo.png\n\n# Phase 2 — DS learning demo\npython scripts/smoke_phase2.py\n# → reports/figures/phase2_letter_C_field.png\n# → reports/figures/phase2_cleaning_demo.png\n\n# Fig. 3 (partial) — Linear transportation (Sec. III-E)\npython scripts/figure3_linear.py --seed 0\n# → reports/figures/phase3_fig3_partial.png\n\n# Fig. 3 (full) — GP transportation (Sec. III-E)\npython scripts/figure3_full.py --seed 0\n# → reports/figures/phase4_fig3_full.png\n\n# Fig. 5 — Transportation scheme (Sec. III-D)\npython scripts/figure5_scheme.py --seed 0\n# → reports/figures/phase4_fig5_scheme.png\n\n# Fig. 5 (with uncertainty) — Sec. III-H\npython scripts/smoke_phase5.py\n# → reports/figures/phase5_fig5_full.png\n\n# Fig. 6 — Uncertainty propagation (Sec. III-H)\npython scripts/figure6_uncertainty.py --seed 0\n# → reports/figures/phase5_fig6_uncertainty.png\n\n# Fig. 7 — 2D surface cleaning comparison (Sec. IV-A)\npython scripts/figure7_cleaning_comparison.py --seed 0\n# → reports/figures/phase6_fig7_comparison.png\n\n# Figs. 8–10 — Multi-frame benchmark (Sec. IV-B)\npython scripts/run_multiframe_benchmark.py --seed 0 --n_reps 20\npython scripts/figure8_qualitative.py --seed 0\n# → reports/figures/phase7_fig8_qualitative.png\npython scripts/figure9_boxplots.py --seed 0\n# → reports/figures/phase7_fig9_boxplots.png\npython scripts/figure10_test_boxplots.py --seed 0\n# → reports/figures/phase7_fig10_test_boxplots.png\n\n# Fig. 11 — Multi-source single-target (Sec. IV-B)\npython scripts/smoke_phase8.py --seed 0\n# → reports/figures/phase8_fig11_multisource.png\n```\n\n---\n\n## Reproduce 3D simulation figures (Sec. V analogs)\n\n```bash\n# Reshelving + arm-pose 3D rollout (Phase 9)\npython scripts/smoke_phase9.py\n# → reports/figures/phase9_reshelving_3d.png\n# → reports/figures/phase9_armpose_3d.png\n\n# Surface cleaning Figs. 15/16 analogs (Phase 10)\npython scripts/figure15_cleaning_surfaces.py --seed 0 --fast\n# → reports/figures/phase10_fig15_cleaning.png\npython scripts/figure16_force_profile.py --seed 0 --fast\n# → reports/figures/phase10_fig16_force.png\n```\n\n---\n\n## Generate portfolio animations\n\n```bash\n# Final single-scene animations (Phase 16)\npython scripts/animate_impedance_reshelving.py --seed 0\n# → reports/figures/final_reshelving.gif\n\npython scripts/animate_impedance_cleaning.py --seed 0\n# → reports/figures/final_cleaning.gif\n\npython scripts/animate_impedance_armpose.py --seed 0\n# → reports/figures/final_armpose.gif\n\npython scripts/animate_impedance_highlight.py\n# → reports/figures/final_highlight.gif\n```\n\n---\n\n## Run tests\n\n```bash\npytest -q                 # all tests\npytest -q -m \"not slow\"   # skip slow regression tests\n```\n\n---\n\n## Run all smoke tests\n\n```bash\npython scripts/smoke_all.py\n# → reports/results/smoke_all_output.txt\n```\n\n---\n\n## Directory structure\n\n```text\nteach-once/\n├── src/gpt_repro/\n│   ├── gp/          # Sec. III-B: GP regression (exact + SVGP)\n│   ├── transport/   # Sec. III:   TP-GPT transportation math\n│   ├── policies/    # Sec. III-A: DS learning, demo generators\n│   ├── baselines/   # Sec. IV:    KMP, LE, E-RF, E-NN, E-NF, TP-GMM, HMM, DMP\n│   ├── metrics/     # Sec. IV-B:  Fréchet, DTW, U-test ranking\n│   ├── viz/         # Figure utilities\n│   ├── envs/        # MuJoCo kinematic environments\n│   └── utils/       # Seeding, IO\n├── scripts/         # Figure scripts + smoke tests + animation scripts\n├── tests/           # pytest unit + integration tests\n├── configs/         # YAML experiment configs\n├── data/            # Generated 2D demonstration trajectories\n├── docs/            # GitHub Pages interactive website\n│   ├── index.html\n│   ├── css/style.css\n│   ├── js/\n│   │   ├── scene.js          # Three.js 3D scene\n│   │   ├── gp_infer.js       # Pure-JS TP-GPT inference (Eqs. 2,3,7,11–13)\n│   │   ├── mode_reshelving.js\n│   │   ├── mode_cleaning.js\n│   │   ├── mode_armpose.js\n│   │   └── ui.js\n│   └── assets/\n│       ├── gifs/             # Pre-computed fallback GIFs\n│       ├── figures/          # 2D paper reproduction figures\n│       └── models/           # Three.js geometry\n└── reports/\n    ├── figures/              # All reproduced figures (PNG)\n    ├── results/              # CSV/NPZ numerical results\n    ├── REPORT.md             # Technical report\n    └── FIGURE_INDEX.md       # Figure → script → paper mapping\n```\n\n---\n\n## Results summary\n\n| Task | Success Rate | Mean EE Error | Notes |\n|------|-------------|---------------|-------|\n| Reshelving | 1/4 (25%) | 0.117 m | 200 steps, attractor gain 1.5 |\n| Cleaning | 0/4 (0%) | 0.280 m | Path correct; endpoint gap = open-loop drift |\n| Arm-pose | 1/4 (25%) | 0.208 m | 200 steps, attractor gain 1.2 |\n\nSuccess rates reflect open-loop kinematic rollout without force-feedback.\nThe paper uses Cartesian impedance control — this gap is documented in\n`reports/REPORT.md`.\n\n---\n\n## Citation\n\n```bibtex\n@article{franzese2024tpgpt,\n  title={Generalization of Task Parameterized Dynamical Systems\n         using Gaussian Process Transportation},\n  author={Franzese, Giovanni and Prakash, Ravi and Kober, Jens},\n  journal={arXiv preprint arXiv:2404.13458},\n  year={2024}\n}\n```\n\n**Original code**: https://github.com/franzesegiovanni/policy_transportation\n**Paper video**: https://youtu.be/bE6uOnAQBLo\n\n---\n\n## Acknowledgements\n\nThis reproduction is based entirely on the work of:\n\n\u003e Franzese, G., Prakash, R., Kober, J. (2024).\n\u003e *Generalization of Task Parameterized Dynamical Systems\n\u003e using Gaussian Process Transportation.*\n\u003e TU Delft · arXiv:2404.13458\n\n- [Paper](https://arxiv.org/abs/2404.13458)\n- [Paper video](https://youtu.be/bE6uOnAQBLo)\n- [Original code](https://github.com/franzesegiovanni/policy_transportation)\n\nReproduction by [Abhinav Jain](https://github.com/jaintle).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaintle%2Fteach-once","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaintle%2Fteach-once","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaintle%2Fteach-once/lists"}