PyTorch Network Loader Documentation#

Python Version PyTorch Version

Version: 3.11.2

Useful links: Source Repository | Issue Tracker | Real-World Example

PyTorch Network Loader is a utility that enables the easy creation of neural networks in PyTorch using JSON configuration files. The package automatically tracks layer output shapes, eliminating the need to manually calculate input dimensions for each layer. NetLoader also provides an architecture framework that allows for the easy architecture setup and training framework, along with additional useful utilities to accelerate the use of neural networks in science.

Key Features#

  • JSON-Based Network Definition: Define neural networks using simple JSON files

  • Automatic Shape Tracking: No need to calculate input shapes for each layer

  • Built-in Training Pipeline: Architectures come with all training functionality included

  • Flexible Architecture Support: Support for pre-built and custom architectures, such as encoders, autoencoders, and normalizing flows

  • Datasets & Data Loaders Framework: Easily create datasets and data loaders for training and evaluation, along with modular data transforms

Quick Example#

import netloader.architectures as archs
from netloader.network import Network

# Load network from JSON configuration
net = Network('config.json', '/path/to/configs/', in_shape=[3, 224, 224], out_shape=[10])

# Create architecture
arch = archs.Encoder(1, '/path/to/save/states/', net, learning_rate=1e-3)

# Train the model for 100 epochs
arch.training(100, (train_loader, val_loader))

# Make predictions
predictions = arch.predict(test_loader)

Getting Started#

Installation

Installation instructions

Installation
User Guide

Guides on using the different components

User Guide
Examples

Real-world examples using NetLoader

Examples
API Reference

API documentation for all modules

API Reference