Xzero UI
Pro library

Model trainingPro

Training data batches feed a small neural net diagram whose connections strengthen, a loss curve descends beside it, and an evaluation check turns green at the end.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/model-training
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/model-training

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ModelTraining } from "@/components/xzero/model-training/model-training";

export function TrainingSection() {
  return <ModelTraining
    classes={["Positive", "Negative"]}
    samples={12800}
    heldOutSamples={1600}
    epochs={12}
    lossFrom={0.69}
    lossTo={0.08}
    accuracy={94.2}
    target={90}
  />;
}

API reference

ModelTraining

An animated model training illustration told in five stages. A batch peels off a layered stack of training data and drops into the input layer of a small neural network drawn on thin plates in 2.5D depth. Signals travel forward along every connection to a prediction, then the error travels back as a short dash and each connection it passes grows a little stronger. Over the epochs batches stream through, the useful connections thicken and take on the accent while the rest stay light, the loss curve descends beside the network and the loss, epoch and prediction readouts count in sync. At the end a held-out set runs through once, the evaluation score counts up, and the check turns green with a Passed tag. A step bar with play and pause replays the story or jumps to any stage, and a caption explains the current stage.

PropTypeDefaultDescription
classesstring[]["Positive", "Negative"]The two labels the model learns to predict, shown beside the output layer with a probability and a bar.
inputsnumber3Units in the input layer, from 2 to 5. Each data sheet shows one line per input feature.
hiddennumber[][4, 4]Units in the two hidden layers, each from 2 to 6.
samplesnumber12800Samples in the training set, shown under the stack and in its hover detail.
heldOutSamplesnumber1600Samples in the held-out set.
batchSizenumber32Samples per batch, used in the caption and hover detail.
epochsnumber12Epochs the story trains for. The epoch readout and the chart axis count to it.
lossFromnumber0.69Loss after the first batch. The curve starts here.
lossTonumber0.08Loss after the last epoch. The curve ends here and the validation point sits just above it.
accuracynumber94.2Accuracy on the held-out set in percent. The evaluation counts up to it.
targetnumber90Accuracy the evaluation must reach, shown under the evaluation name.
labels{ training?: string; heldOut?: string; unit?: string; input?: string; hidden?: string; output?: string; loss?: string; epoch?: string; evaluation?: string; waiting?: string; running?: string; passed?: string; noBatch?: string }Training set, Held-out set, reviews, Input, Hidden, Output, Loss, Epoch, Evaluation, Waiting, Running, Passed, Waiting for a batchNames on the diagram and readouts. unit is what one sample is and follows every sample count.
stepsstring[]["Batch", "Forward pass", "Backprop", "Epochs", "Evaluate"]Labels for the five stages in the step bar.
defaultStepnumber–Stage to start on, from 0 to 4. When held or with reduced motion it picks the still frame; otherwise the finished, evaluated model is shown.
captionbooleantrueShows a sentence under the step bar that explains the current stage. On narrow layouts it also names the stage.
controlsbooleantrueShows the step bar with play and pause.
speednumber1Multiplies the playback speed. One full run takes about 21 seconds at 1. 0 holds still.
pausedbooleanfalseHolds the illustration still. Held from the start, it shows the finished, evaluated model.
accentstring–Any CSS color for signals, the error dash, learned connections, the loss curve and the active stage. Defaults to the accent token. The passed state keeps the success color.
labelstring–Accessible description of the diagram. Built from the classes and numbers when left out.
classNamestring–Extra class on the root figure.
styleCSSProperties–Inline styles on the root figure.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in illustrations

Guidance for AI tools

Model training: Training data batches feed a small neural net diagram whose connections strengthen, a loss curve descends beside it, and an evaluation check turns green at the end. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components