HungVQ1991/VulkanML ? reverse-engineered prompt
Reverse engineered prompt
Build me a lightweight deep learning framework in modern C++23 that can train simple neural networks from scratch, without using PyTorch or TensorFlow.
I want it to support basic tensor and matrix math, a sequential model, forward and backward propagation, common layers like dense, convolution, max pool, batch norm, and activations like ReLU, GELU, and softmax. It should also include losses like MSE, cross entropy, MAE, and BCE, plus optimizers like SGD and Adam, with a few learning rate schedules.
Please make it work on both CPU and Vulkan compute, with one clean interface so I can switch between them. It should also be able to save and load models in a simple binary format that restores the network structure automatically. If it makes sense, include a small example and a basic test or demo that shows training a model and saving a checkpoint. Look up current Vulkan and C++23 docs online if you need to.
Are you gonna build this?
make sure you review the code using coderabbit