A minimal, educational neural network library built from scratch in C++17.
1git clone https://huggingface.co/notRaphael/newnet
2cd newnet
3g++ -std=c++17 -O2 -pthread -o newnet main.cpp
4./newnet
newnet/
├── core/
│ ├── tensor.hpp ← Tensor class (data + grad + shape)
│ └── backend.hpp ← All math ops (matmul, relu, sigmoid, etc.)
│ Swap THIS file for SYCL/GPU backend.
├── layers/
│ ├── layer.hpp ← Abstract base class
│ └── dense.hpp ← Fully connected layer (forward + backward)
├── graph/
│ ├── graph.hpp ← Sequential model (chains layers)
│ └── optimizer.hpp ← SGD optimizer
├── loss/
│ └── loss.hpp ← MSE loss
└── main.cpp ← XOR training example with progress bar
To port to GPU: replace this ONE file with SYCL kernels. Everything else stays the same.
This model repository was generated by
ML Intern, an agent for machine learning research and development on the Hugging Face Hub.
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_id = "notRaphael/newnet"
4tokenizer = AutoTokenizer.from_pretrained(model_id)
5model = AutoModelForCausalLM.from_pretrained(model_id)