PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteYou can build a small deep-learning library in Python with NumPy by implementing array operations for a forward pass, a loss, backpropagated gradients, and parameter updates. Start with one feedforward classifier: it makes the mechanics visible without pretending to replace production frameworks. A useful next step is to separate those mechanics into reusable layers, losses, optimizers, and gradient checks.
What you need before you start
Be comfortable with Python functions and modules, NumPy arrays and their shapes, matrix multiplication, and the basic idea of a neural network. NumPy’s MNIST tutorial also uses Matplotlib and Python modules for data handling. If those prerequisites are unfamiliar, it recommends Andrew Trask’s Grokking Deep Learning as a NumPy-focused introduction.
The goal here is not to build every feature of a framework. It is to make a small implementation whose intermediate values and derivatives you can inspect and test.
How a training step fits together
Training connects four operations. First, the model maps an input batch to predictions. Second, a loss measures how far predictions are from the targets. Third, backpropagation applies the chain rule to find how each parameter affected that loss. Finally, an optimizer uses those gradients to change the parameters. NumPy’s tutorial presents this forward-computation, loss, backward-computation, and update sequence for a small MNIST network.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Forward: compute each layer’s weighted sums and activations from the input.
- Loss: compare the output scores with the target labels using a scalar objective.
- Backward: propagate derivatives from the loss through each operation to the weights.
- Update: subtract a learning-rate-scaled gradient from each weight.
Each array shape encodes a part of the computation. For a batch of B flattened MNIST images, an input array can have shape (B, 784). If the hidden layer has H units and there are ten digit classes, the two weight matrices have shapes (784, H) and (H, 10). Matrix multiplication then produces hidden activations of shape (B, H) and output scores of shape (B, 10).
Build the smallest useful classifier
The NumPy tutorial describes MNIST as 60,000 training images and 10,000 test images, each 28 by 28 pixels. Flattening each image gives 784 input values; the ten output scores correspond to the ten digit classes. Those counts describe the dataset scale in that tutorial, not a requirement for every implementation.
Forward pass and loss
For input matrix X, weights W1 and W2, and a ReLU hidden activation, the forward pass is Z1 = X @ W1, H = max(0, Z1), then S = H @ W2. The score matrix S has one row per example and one column per class. A classifier predicts the class whose score is largest in each row.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
The tutorial’s example deliberately keeps the model simple: it uses one hidden layer, ReLU and dropout, omits bias terms, and uses summed squared error for simplicity. The following compact code is a related teaching variant, not a reproduction of every tutorial choice: it omits dropout too and averages squared error over the output elements. It includes the backward pass so the chain rule and shapes remain explicit.
import numpy as np
def relu(x):
return np.maximum(0, x)
def train_step(x, target, w1, w2, learning_rate):
# x: (batch, 784); target: one-hot labels, shape (batch, 10)
z1 = x @ w1 # (batch, hidden)
hidden = relu(z1) # (batch, hidden)
scores = hidden @ w2 # (batch, 10)
error = scores - target
loss = np.mean(error ** 2)
# Derivative of mean squared error with respect to the scores.
d_scores = 2 * error / error.size
d_w2 = hidden.T @ d_scores
d_hidden = d_scores @ w2.T
d_z1 = d_hidden * (z1 > 0)
d_w1 = x.T @ d_z1
w1 -= learning_rate * d_w1
w2 -= learning_rate * d_w2
return loss, w1, w2
def predict(x, w1, w2):
hidden = relu(x @ w1)
scores = hidden @ w2
return np.argmax(scores, axis=1)
The gradient at the output is propagated through W2 to the hidden activations, then through ReLU to Z1, and finally to W1. The ReLU derivative is zero where its input was not positive and one where it was positive. The code caches z1 and hidden from the forward pass because the backward pass needs them. It omits biases to keep the example short; a neuron equation with a bias is shown in the published chapter A Neural Net from the Foundations.
This example expects inputs and one-hot targets to have compatible shapes and numeric values. It does not load, normalize, or split a dataset, initialize weights, or provide regularization. Those are separate concerns rather than hidden behavior of train_step. The loss choice is also part of the teaching variant: do not mistake this averaged loss for the NumPy tutorial’s summed squared error.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Turn one fixed network into reusable components
A single function is easy to inspect, but it becomes cumbersome as the model grows. A library takes the same operations and gives them clear responsibilities. The precise API is a design choice; the documented examples support several useful boundaries rather than one mandatory interface.
| Component | Responsibility | What it needs for backward propagation |
|---|---|---|
| Layer, such as a dense layer | Own parameters and compute a transformation such as an input multiplied by a weight matrix. | Its input and parameters, retained or passed back from the forward pass. |
| Activation | Apply a nonlinear operation such as ReLU. | The relevant forward value or mask needed for its derivative. |
| Loss | Compare model output with target data and return an objective. | Predictions and targets, so it can produce the derivative with respect to the output. |
| Optimizer | Update parameters using their gradients. | Parameters, gradients, and optimizer-specific state if the method uses any. |
| Training and evaluation loop | Coordinate batches, forward passes, gradient propagation, updates, and measurement. | Training or evaluation behavior appropriate to the model’s components. |
A practical progression is to move the computations into these components one at a time. Keep a forward pass’s inputs or outputs in a per-call cache for use by the matching backward pass. For example, a ReLU operation can cache which inputs were positive; a dense layer can cache its input to calculate the weight gradient. Avoid storing temporary values as global state: separate calls, batches, or nested computations should not overwrite each other’s backward data.
The nn-numpy-from-scratch project documentation describes component boundaries, cached forward information, training and evaluation behavior, and gradient checking. These are useful implementation concerns, not an independent benchmark or a standard that every library must follow.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Check the gradients before trusting training
A network can produce plausible-looking predictions while a derivative is wrong. Validate backward methods on small inputs, where a finite-difference estimate is practical. For a parameter value θ, estimate its loss derivative as (L(θ + ε) - L(θ - ε)) / (2ε), then compare that estimate with the analytic gradient from backpropagation. Use a small test problem and a numerical tolerance rather than expecting exact equality: finite differences are approximations.
The Adam Mickiewicz University chapter on implementing backpropagation from scratch describes numerical gradient verification. The project documentation also describes finite-difference checks for layer and loss gradients. A mismatch narrows the debugging target to the derivative, shape handling, or cached forward values; a passing check does not prove that every possible bug or numerical issue is absent.
- Start with tiny arrays and a loss that is easy to evaluate.
- Check one component at a time, then check the composed network.
- Use inputs away from nondifferentiable points when checking a piecewise activation such as ReLU.
- Verify that both the analytic and numerical calculations use the same loss reduction, such as a sum or mean.
Train and evaluate without mixing up the data
Keep training and test examples separate. Update parameters using training data; use the test split to measure behavior on examples the model has not seen during those updates. The NumPy tutorial explicitly distinguishes MNIST’s training and test sets. The test set is not another training batch, and repeatedly using it to make design decisions weakens its role as an evaluation set.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
A minimal loop repeatedly takes a training batch, calls the forward and loss operations, computes gradients, and updates parameters. Track loss on training data to see whether optimization is progressing. After training, run prediction or evaluation on the held-out test data without updating weights. The tutorial includes dropout; components that behave differently during training and evaluation need an explicit mode so evaluation does not accidentally retain training-only behavior. The cited project documentation describes such mode handling for dropout and batch normalization.
Do not infer an accuracy result from the architecture or from code alone. A result depends on details such as initialization, preprocessing, hyperparameters, and training duration; no outcome is claimed here for the illustrative code.
Know what this project does—and does not—teach
There is a meaningful difference between a one-model demonstration and a general-purpose framework. The NumPy tutorial demonstrates a small MNIST network. Andrei Nicolae’s 2020 paper, “Deep Learning Framework From Scratch Using Numpy,” describes a broader implementation that includes automatic differentiation and demonstrations beyond classification. These are different scope levels, not controlled alternatives whose speed or accuracy can be compared from the cited material.
| Learning target | What to implement | What it clarifies |
|---|---|---|
| One-model demonstration | A fixed sequence of array operations and hand-derived backward equations. | How the chain rule connects a loss to individual parameter updates. |
| Reusable NumPy components | Layers, activations, losses, optimizers, caches, and training/evaluation behavior. | How a network is composed from operations that can be reused and tested. |
| Broader framework capabilities | Potentially automatic differentiation and support for a wider range of models or tasks. | How framework machinery generalizes beyond manually deriving each network’s backward pass. |
Implementing the first two stages is a strong learning exercise: it exposes the computations, their shapes, and the places where errors arise. The cited materials do not establish that a tutorial-sized implementation is production-ready, supports broad model coverage, or matches established frameworks in performance.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

