Skip to main content

Module gpu_neural_solver

Module gpu_neural_solver 

Source
Expand description

GPU neural network solver for physics (CPU mock backend).

Provides a multi-layer perceptron (MLP) framework and physics-informed neural network (PINN) utilities:

Structs§

GpuNeuralSolver
Multi-layer perceptron running on the CPU mock GPU backend.
NeuralLayer
A single fully-connected (dense) neural network layer.
PhysicsNeuralNet
Physics-informed neural network (PINN).

Functions§

ns_mae_loss
Mean absolute error loss: mean(|predicted_i − target_i|).
ns_mse_loss
Mean-squared error loss: mean((predicted_i − target_i)²).
ns_relu
Rectified linear unit activation: max(0, x).
ns_sigmoid
Logistic sigmoid activation: 1 / (1 + e^{-x}).
ns_softmax
Softmax of a slice: normalised exponentials exp(x_i) / Σ exp(x_j).
pinn_boundary_loss
Boundary-condition loss: MSE between the predicted boundary values and the prescribed Dirichlet data.
pinn_residual
Physics-informed residual for the 1-D Poisson equation −u_xx = source.