ertk.pytorch.models

PyTorch implementations of various models.

get_pt_model(name, **kwargs)

Get a PyTorch model by name.

get_pt_model_fn(name, **kwargs)

Get a PyTorch model creation function.

PyTorchModelConfig(optimiser, opt_params, ...)

Base class for PyTorch model configuration dataclasses.

ERTKPyTorchModel(config)

Base class for PyTorch models.

SimpleModel(config)

A model that takes input x, gives output y, and has a single loss function.

SimpleClassificationModel(config)

A classification model that takes input x, gives output probabilities y, and has a single loss function.

LightningWrapper(model, config)

Wraps a torch Module instance to make it compatible with PyTorch Lightning.

Models

aldeneh2017

Implementation of the model architecture from [Re3b58da5fc0a-1].

mlp

Simple multi-layer perceptron (MLP) model.

zhang2019

Implementation of the model from [Rdb37ca905c48-1].

Layers

layers

PyTorch layers for use in models.