AIsaac

Library for dl

This library is a work in progress to become a deep learning library for my own use.

The code in this library is heavily inspired by the miniai library developed as part of the part 2 course. I am writing the Deep Learning portions myself, but other parts of the library are taken directly from that library (ie memory cleaning functions, plotting helper functions, etc.). This is very much a work in progress at the very early/beginning stages. It’s not ready for practical use (yet!).

Install

Cone the repo and do an editable install. You will almost certainly need to modify the library as you use it given the early stages it is in.

pip install -e .[dev]

How to use

Dataloaders

HuggingFace Dataset Dict

from datasets import Dataset, load_dataset
from AIsaac.dataloaders import DataLoaders
import torchvision.transforms.functional as TF
from AIsaac.utils import inplace

xmean,xstd = 0.28, 0.35

@inplace
def transformi(b): b['image'] = [(TF.to_tensor(o)-xmean)/xstd for o in b['image']]

_dataset = load_dataset('fashion_mnist').with_transform(transformi)
dls = DataLoaders.from_dataset_dict(_dataset, 64, num_workers=4)
dls.show_batch(3)
Found cached dataset fashion_mnist (/home/.cache/huggingface/datasets/fashion_mnist/fashion_mnist/1.0.0/8d6c32399aa01613d96e2cbc9b13638f359ef62bb33612b077b4c247f6ef99c1)

Pytorch Datasets

Data Augmentation

Use Existing Augmentations

  • Item vs Batch Aug
  • CPU vs GPU Aug

Add New Augmentation

  • Item vs Batch Aug
  • CPU vs GPU Aug

Training Loop

  • Callback System
  • Modification Ex.

Models

  • Pytorch Model
  • Timm Model
  • HuggingFace Model

Metrics

  • Use Existing Metric
  • Create New Metric

Optimizers

  • Use Existing Optimizer
  • Create New Optimizer

Loss Functions

  • Use Existing Loss Function
  • Create Loss Function

Model Evaluations

  • Activation Stats
    • Color Dim
    • Dead Chart
    • Plot Stats
  • Plot Loss
  • Logging with W&B