salad.utils package

Submodules

salad.utils.augment module

class salad.utils.augment.AffineTransformer(*args, **kwargs)

Bases: torch.nn.modules.module.Module

affine(y, theta)
invert_affine(M)

Invert matrix for an affine transformation. Supports batch inputs

M : Transformation matrices of shape (… x 6)

Output: Inverse transformation matrices of shape (… x 6)

stn(x, theta)
class salad.utils.augment.RandomAffines(flip_x=0.5, flip_y=0.5, shear_x=(0, 0.3), shear_y=(0, 0.3), scale=(0.8, 1.4), rotate=(-1.5707963267948966, 3.141592653589793), dx=(-0.2, 0.2), dy=(-0.2, 0.2))

Bases: object

compose(size)
identify(size)
matmul(A, B)
reflect(size, p=0.5)
rotated(size, p=0.5)
scaled(size, p=0.5)
shear(size, p=0.5)
shift(size, p=0.5)

salad.utils.base module

salad.utils.base.load_or_create(init_func, path)
salad.utils.base.panelize(img)

salad.utils.config module

Experiment Configurations for salad

This file contains classes to easily configure experiments for different solvers available in salad.

class salad.utils.config.BaseConfig(description, log='./log')

Bases: argparse.ArgumentParser

Basic configuration with arguments for most deep learning experiments

print_config()
class salad.utils.config.DomainAdaptConfig(description, log='./log')

Bases: salad.utils.config.BaseConfig

Base Configuration for Unsupervised Domain Adaptation Experiments

salad.utils.evaluate module

salad.utils.evaluate.evaluate(checkpoints, data_loader, domain)

salad.utils.finetune module

class salad.utils.finetune.FinetuneSolver(*args, **kwargs)

Bases: salad.solver.classification.BaseClassSolver

class salad.utils.finetune.Loss(model)

Bases: object