AMEVA-Forge Documentation

Release 2.0.0 Initializing WebGPU... [ Live WebGPU Studio ] [ GitHub Repository ]

1. MNIST Inference (Live WebGPU Handwritten Digit Recognition)

Draw a digit (0-9) on the canvas below. The neural network infers the digit in real-time utilizing the AMEVA-Forge WebGPU backend and pre-trained weights.

Device Target: WebGPU
Predicted Digit: --
Confidence: --%
Latency: 0.0 ms

Drawing Canvas (280x280)

Top Prediction
--
Waiting for Input

10-Class Softmax Probabilities

Model Architecture: Linear(784, 256)ReLULinear(256, 10)Softmax

AMEVA-Forge Python Neural Network Definition (Running on WebGPU)

[ PyTorch Drop-in API ]
import forge as torch
import forge.nn as nn

# 1. Define PyTorch-compatible Neural Network
class MNISTModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.net = nn.Sequential(
            nn.Linear(784, 256),
            nn.ReLU(),
            nn.Linear(256, 10)
        )
    def forward(self, x):
        return self.net(x)

# 2. Deploy to WebGPU device and infer in real-time
model = MNISTModel().to("gpu")
x_gpu = torch.tensor(canvas_28x28_pixels, device="gpu")
logits = model(x_gpu)
predicted_digit = torch.argmax(logits)

Technical & Mathematical Deep-Dive