Class WeightLoader
- Namespace
- AiDotNet.ComputerVision.Weights
- Assembly
- AiDotNet.dll
Loads pre-trained model weights from various file formats.
public class WeightLoader
- Inheritance
-
WeightLoader
- Inherited Members
Remarks
For Beginners: This class reads saved neural network weights from files. Deep learning models are trained on massive datasets, and the learned parameters (weights) can be saved and reloaded. This allows you to use pre-trained models without training from scratch.
Supported formats: - PyTorch (.pt, .pth) - Python pickle with tensor data - SafeTensors (.safetensors) - Safe tensor format - NumPy (.npy, .npz) - NumPy array format - ONNX (.onnx) - Open Neural Network Exchange format
Constructors
WeightLoader()
Creates a new weight loader.
public WeightLoader()
Methods
LoadWeights(string)
Loads weights from a file and returns them as a dictionary.
public Dictionary<string, Tensor<float>> LoadWeights(string filePath)
Parameters
filePathstringPath to the weight file.
Returns
- Dictionary<string, Tensor<float>>
Dictionary mapping layer names to weight tensors.