How kashkovvv/neural_network works
This is a header-only C++ neural-network math library. Its implemented workflow is to create and manipulate tensors, pass them through a linear layer and activation functions, then compare predictions with a loss; these are independent building blocks, not an assembled network. Tensor views provide slice-based access, while indexing, concepts, and compensated accumulation support the core implementation. The README describes training, autograd, data pipelines, and additional models as future work, not current capabilities. Edges reflect shown includes, calls, or documented behavior; unsampled implementation details are not inferred.
Main entry points: tensor.hpp Tensor operations · tensor_view.hpp Tensor views · linear.hpp Linear layer · losses.hpp Loss functions
Components 9
Tensor core
- Tensor operations
include/nn/tensor.hpp - Tensor views
include/nn/tensor_view.hpp
Network components
- Linear layer
include/nn/linear.hpp - Activations
include/nn/activations.hpp - Loss functions
include/nn/losses.hpp
Implementation support
- Tensor indexing
include/nn/detail/tensor_indexing.hpp - Type constraints
include/nn/detail/tensor_concepts.hpp - Stable accumulation
include/nn/detail/compensated_accumulator.hpp
Other components
- Library user
Connections 15
- Library user → Tensor operations: creates and operates
README.md - Library user → Linear layer: applies layer
README.md - Library user → Activations: applies activation
README.md - Library user → Loss functions: evaluates loss
README.md - Tensor operations → Tensor views: creates views
include/nn/tensor.hpp - Tensor operations → Tensor indexing: uses indexing
include/nn/tensor.hpp - Tensor operations → Type constraints: constrains elements
include/nn/tensor.hpp - Tensor operations → Stable accumulation: accumulates reductions
include/nn/tensor.hpp - Tensor views → Tensor indexing: uses indexing
include/nn/tensor_view.hpp - Tensor views → Type constraints: constrains elements
include/nn/tensor_view.hpp - Linear layer → Tensor operations: computes matmul
include/nn/linear.hpp - Linear layer → Type constraints: constrains elements
include/nn/linear.hpp - Activations → Tensor operations: transforms tensors
include/nn/activations.hpp - Loss functions → Tensor operations: reads and returns tensors
include/nn/losses.hpp - Loss functions → Stable accumulation: accumulates loss
include/nn/losses.hpp