Skip to content

NectarGAN API - Home

The NectarGAN API is a fully modular, highly extensible PyTorch-based framework comprised of easy to use building blocks for assembling, training, and testing conditional GAN models.

The API documentation is broken down into a number of sections:

Config

At the core of the NectarGAN API's functionality is the JSON-based configuration system. Config files are parsed by the ConfigManager into a set of Config dataclasses, allowing for easy access to any config value anywhere you need it. The configuration system is also at the core of the experiment tracking mechanisms in the NectarGAN API.

For more information, please see here

Models

The API provides a modular UNet-style generator and PatchGAN discriminator model, both of which allow you to drop in your own convolutional blocks if you so choose.

For more information about the UNet model, please see here.
For more information about the PatchGAN model, please see here

Dataset

The API provides a helper class called PairedDataset for loading dataset data for paired images translation models. These is also a helper class called Transformer for performing Albumentations-based dataset augmentations.

For more information, please see here.

Trainers

The API's Trainer class is an inheritable baseline class for training GAN models with a overrideable training methods and a number of helper functions for speeding up model creation. The Pix2pixTrainer serves as an example implementation of a Pix2pix-style[^1] cGAN model using the Trainer class as a base.

For more information, please see here.

Testers

The API's Tester class allows you to test your trained model on a test dataset.

For more information, please see here.

Losses

The API includes a robust and hightly extensible loss tracking and management system, the core of which is the LossManager, a drop-in solution for handling all things related to loss in your models.

For more information about the LossManager, please see here.
For information about loss specs, simple functions that can be used to define reuseable objective functions in combination with the LossManager, please see here.
For more information about the loss Modules included with the NectarGAN API, please see here.

Scheduling

The API has a simple schedule wrapper, allowing you to define schedules as Python functions and apply them to learning rates and loss weights.

For more information, please see here.

Visdom

The API includes a utility class called VisdomVisualizer for live loss graphing and visualization of [x, y_fake, y] image sets during training via Visdom.

For more information, please see here.

ONNX Tools

The API includes a simple ONNX converter class and model tester script for convenience.

For more information, please see here.

[^1]: Pix2Pix: Image-to-Image Translation with Conditional Adversarial Networks (Isola et al., 2017)