Overview of tiny-cuda-nn components
masterThe tiny-cuda-nn framework consists of several specialized components for neural network training and inference. These include highly optimized networks, various input encodings, loss functions, and optimizers.
Networks
- Fully fused MLP: A lightning-fast implementation for small multi-layer perceptrons (MLPs).
- CUTLASS MLP: An MLP based on CUTLASS GEMM routines. It is slower than the fully-fused version but handles larger networks.
Input Encodings
- Composite: Composes multiple encodings (e.g., for Neural Radiance Caching).
- Frequency: NeRF-style positional encoding applied equally to all dimensions.
- Grid: Trainable multiresolution grids (used in Instant NGP). Supports hashtables, dense storage, or tiled storage.
- Identity: Leaves input values untouched.
- Oneblob: Based on Neural Importance Sampling and Neural Control Variates.
- SphericalHarmonics: Frequency-space encoding suitable for direction vectors.
- TriangleWave: A low-cost alternative to NeRF's encoding.
Losses
- L1 / Relative L1: Standard and prediction-normalized L1 loss.
- MAPE / SMAPE: Mean absolute percentage error and symmetric MAPE.
- L2 / Relative L2 / Relative L2 Luminance: Standard L2, prediction-normalized L2, and luminance-normalized L2 (for RGB predictions).
- Cross Entropy: Standard cross entropy (for PDF predictions).
- Variance: Standard variance loss (for PDF predictions).
Optimizers
- Adam: Implementation of Adam/AdaBound.
- Novograd: Implementation of Novograd.
- SGD: Standard stochastic gradient descent.
- Shampoo: 2nd order Shampoo optimizer.
- Average / EMA: Wrappers that compute a linear or exponential moving average of weights for inference.
- Batched: Wraps an optimizer to invoke it every N steps on averaged gradients (simulates larger batch size with constant memory).
- Composite: Allows using different optimizers on different parameters.
- Exponential Decay: Performs piecewise-constant exponential learning-rate decay.
- Lookahead: Implements the lookahead algorithm.