Skip to content

Examples

12 example programs, to read how each task looks in Talario. To run them you need a licensed Talario build, available through sales.

MNIST training

Training

Train a 784-128-10 ReLU MLP on real MNIST digits with softmax cross-entropy and mini-batch SGD or Adam.

ConvNet on MNIST

ConvNets

Train a convolutional net (Conv2d 1->8 3x3 -> ReLU -> Linear) on MNIST with softmax cross-entropy and Adam.

Synthetic classifier

Training

Train a 2-16-3 ReLU MLP with softmax cross-entropy on a 3-class synthetic cluster dataset.

Fit y = |x|

Training

Fit the absolute-value function with a tiny 1-8-1 ReLU MLP trained by SGD, as a minimal learning demo.

GNN node classification

Graph (GNN)

Train a 2-layer GCN (GCNConv 4->8 -> ReLU -> GCNConv 8->2) to separate two graph communities from node features + structure via deterministic message passing.

Transformer encoder block

Transformers

A pre-norm Transformer encoder block (LayerNorm/RMSNorm -> self-attention -> residual -> FFN) trains end-to-end natively in PHP on CPU or GPU, overfitting a sequence pair.

Data-parallel training

Distributed

Data-parallel training: R identical replicas on disjoint shards with gradient all-reduce keeping them bit-identical (Phase 3).

Compiled-graph training

Compilation

AOT-compile forward+backward into one replayable command buffer, then each step is just run() + opt->step().

Persistent inference server

Serving

Build a device + model + compiled forward graph once and serve many inference requests with zero per-request setup (selftest / socket / userland HTTP modes).

FrankenPHP worker serving

Serving

Blueprint for FrankenPHP worker-mode serving: model built once per worker and replayed per request (requires the FrankenPHP SAPI).

Distributed DQN (RL)

Reinforcement learning

Ape-X-shaped distributed DQN: forked async collectors feed a shared replay buffer while a Talario learner trains with TD targets and a target net.

PPO with shared trunk (RL)

Reinforcement learning

Clipped PPO with entropy bonus and a shared trunk feeding policy and value heads, trained via the softmaxCrossEntropy target-construction trick plus GAE.