Metadata-Version: 2.4
Name: agi-app-pytorch-playground
Version: 2026.6.12
Summary: AGILAB PyTorch playground app for reproducible neural-network experiments
Author: Jean-Pierre Morard
Maintainer: Jean-Pierre Morard
License-Expression: BSD-3-Clause
Project-URL: Documentation, https://thalesgroup.github.io/agilab
Project-URL: Source, https://github.com/ThalesGroup/agilab/tree/main/src/agilab/lib/agi-app-pytorch-playground
Project-URL: Issues, https://github.com/ThalesGroup/agilab/issues
Project-URL: Homepage, https://github.com/ThalesGroup/agilab
Project-URL: Repository, https://github.com/ThalesGroup/agilab
Project-URL: Discussions, https://github.com/ThalesGroup/agilab/discussions
Project-URL: Changelog, https://github.com/ThalesGroup/agilab/releases
Keywords: agilab,apps,pytorch,reproducibility,workflow-orchestration
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: agi-env<2027.0,>=2026.05.31
Requires-Dist: agi-node<2027.0,>=2026.05.31
Dynamic: license-file

# agi-app-pytorch-playground

[![PyPI version](https://img.shields.io/pypi/v/agi-app-pytorch-playground.svg?cacheSeconds=300)](https://pypi.org/project/agi-app-pytorch-playground/)
[![Python versions](https://img.shields.io/pypi/pyversions/agi-app-pytorch-playground.svg)](https://pypi.org/project/agi-app-pytorch-playground/)
[![License: BSD 3-Clause](https://img.shields.io/pypi/l/agi-app-pytorch-playground)](https://opensource.org/licenses/BSD-3-Clause)

`agi-app-pytorch-playground` publishes the `pytorch_playground_project` AGILAB
app as a self-contained PyPI payload. It turns an interactive neural-network
playground into an executable AGILAB app with persisted arguments, worker
execution, and deterministic evidence artifacts.

## Purpose

Use this package to train a small PyTorch classifier on generated visual
datasets, watch the decision boundary move with play/pause controls, inspect
the resulting boundary/layers/loss terrain, and keep the configuration and
artifacts replayable.

Classic browser neural-network playgrounds are still the shortest beginner
teaching route. This package is the engineering-oriented step after that:
PyTorch-native execution, replay tokens, deterministic manifests, evidence ZIPs,
and reusable PyTorch/Lightning code from the same visual lesson.

## Installed Project

The distribution name is `agi-app-pytorch-playground`; the AGILAB project name
is `pytorch_playground_project`. The package exposes both
`pytorch_playground` and `pytorch_playground_project` through the `agilab.apps`
entry point group, so `AgiEnv(app="pytorch_playground_project")` resolves the
project without a monorepo checkout.

## Install

```bash
pip install agi-app-pytorch-playground
```

The app project itself installs PyTorch when AGILAB prepares its project
environment. The payload package stays lightweight and only exposes the project
root.

## Direct Launch

When AGILAB is installed, launch the app-managed Streamlit surface directly:

```bash
agilab pytorch-playground
```

To open the hosted backend instead of a local app virtual environment:

```bash
agilab pytorch-playground --backend hf
```

Use `AGILAB_PYTORCH_PLAYGROUND_HF_URL` or `--hf-space owner/agilab` for a
custom Hugging Face Space.

## Run In AGILAB

Select `pytorch_playground_project`, then open `ANALYSIS` for the app-owned
PyTorch Playground surface. That surface places persisted ORCHESTRATE
arguments next to the decision boundary, training curves, neuron/loss views,
evidence download, a one-click `Run instant demo` path, a deterministic
`Train / refresh` path, and a live play/pause mode for watching bounded epoch
ticks without leaving ANALYSIS. The boundary-first panel shows the final
surface through a WebGL-first `agi-web` island with Canvas2D fallback, local
epoch scrubbing, play/pause replay, clickable timeline, keyboard controls,
confidence HUD, glowing uncertainty contour, and hover probability readouts,
with Plotly detail tabs kept for evidence inspection and lesson cards for
replayable circles, XOR feature engineering, spiral capacity, and gaussian
sanity-check variants.

Open `ORCHESTRATE` when you want the reproducible AGILAB execution path: tune
the sidebar fields, then run `INSTALL` and `RUN`. Enable loss-landscape
computation only when you want the heavier 3D projection in the evidence
bundle.

## Expected Inputs

The default run generates a synthetic dataset. No external dataset, API key,
notebook, cloud service, or private model is required.

## Expected Outputs

The run writes the playground config, samples, training history, decision grid,
network-layer summary, activation maps, optional loss landscape, a manifest,
and a deterministic evidence ZIP.

## Change One Thing

Switch the dataset from circles to XOR or spiral, then rerun the app. The
manifest and training-history artifacts should make the changed behavior
auditable.

## Scope

This is an educational reproducibility app. It is not a production trainer,
model registry, serving stack, or generic app-agnostic analysis page. The
PyTorch-specific UI stays inside the app project; reusable apps-pages remain
optional artifact readers for shared contracts.
