An open API service indexing awesome lists of open source software.

https://github.com/justinli6886/synapse-runner

Train small neural nets built from scratch in TypeScript on a browser runner—imitation learning, actor–critic policy gradients, and evolution strategies—with React and live metrics; one game loop, client-side.
https://github.com/justinli6886/synapse-runner

behavioral-cloning evolutionary-algorithm from-scratch game-development machine-learning neural-network react reinforcement-learning typescript vite

Last synced: 2 months ago
JSON representation

Train small neural nets built from scratch in TypeScript on a browser runner—imitation learning, actor–critic policy gradients, and evolution strategies—with React and live metrics; one game loop, client-side.

Awesome Lists containing this project

README

          

# Synapse Runner

[![CI](https://github.com/JustinLi6886/synapse-runner/actions/workflows/ci.yml/badge.svg)](https://github.com/JustinLi6886/synapse-runner/actions/workflows/ci.yml)

![Synapse Runner — imitation learning mode](docs/readme-screenshot.png)

*Screenshot: **Imitation learning** — record demos, train behavioral cloning, inspect metrics.*

**Live:** [synapserunner.com](https://www.synapserunner.com/) · **Repo:** [github.com/JustinLi6886/synapse-runner](https://github.com/JustinLi6886/synapse-runner) · **Current release:** `v2.3.1`

A browser runner where the point isn’t flashy graphics—it’s an end-to-end **play → observe → train** loop in TypeScript. One game engine drives human control, recorded demos, and learning, all without a backend for the core experience.

**At a glance (resume-friendly):** React, Vite, custom side-scroller simulation, small neural nets implemented in TS (forward passes, losses, policy-gradient and evolution updates), persisted settings/models in `localStorage`, and live training metrics in the UI.

---

## Why it exists

I wanted a project where “it runs in the game” isn’t hand-wavy: observations come from real state, and the nets either clear obstacles or they don’t. The dashboard is busy on purpose—thresholds, vectors, and charts—so you can see whether training is doing something useful.

---

## Modes

| Mode | What you do |
|------|----------------|
| **Human** | Play with keyboard or tap; the reference behavior. |
| **Imitation** | Record frames, behavioral cloning on your data, export/import datasets. |
| **Policy gradient** | Actor–critic rollouts, GAE-style advantages, greedy eval, charts. |
| **Evolution** | Population fitness, mutation, generations. |

---

## Stack

| Layer | Notes |
|--------|--------|
| **UI** | React 19, Tailwind CSS 4, Recharts, Lucide icons |
| **Build** | Vite 7, TypeScript ~5.9, ESLint |
| **ML** | Feedforward nets in TS—e.g. BCE/MSE training, policy-gradient updates |
| **State** | `localStorage` persistence, sanitized imports |

---

## Run locally

**Node 20+** (see `engines` in `package.json`).

```bash
npm install
npm run dev
```

Open the URL Vite prints (this project defaults to port **3000**).

```bash
npm run build # typecheck + production bundle
npm run lint
npm run preview # optional: serve the production build locally
```

---

## License

[MIT](./LICENSE) — Copyright (c) 2026 Justin Junze Li.

Feedback and bug reports are welcome via GitHub issues.