Skip to main content

Module gpu_nn

Module gpu_nn 

Source
Expand description

GPU-accelerated neural network compute (CPU mock backend).

Provides layer-wise forward passes, backpropagation gradients, and an Adam optimizer — all running on the CPU as a mock GPU backend.

Structs§

AdamOptimizer
Adam adaptive moment estimator.
BackpropGpu
Backpropagation state: stores per-layer gradient tensors.
GpuNeuralNet
A sequential neural network backed by a CPU mock GPU context.
GpuTrainer
Combines a network, a backprop context, and an optimiser for training.
NeuralLayer
A single layer in a neural network, carrying weights, biases and a type.

Enums§

LayerType
The computational type of a single neural network layer.
OptimizerType
Optimiser selection for the GPU trainer.

Functions§

mse_loss
Mean-squared error: mean((pred_i - target_i)^2).
relu
Rectified linear unit: max(0, x).
sigmoid
Logistic sigmoid: 1 / (1 + e^{-x}).
softmax
Softmax of a slice: exp(x_i) / sum(exp(x_j)).