peal.generators.interfaces.Generator

class peal.generators.interfaces.Generator[source]

Bases: Module, ABC

Base class of every PEAL generator.

A torch.nn.Module that a concrete generator subclasses to provide the two operations the library needs from any generative model: drawing samples and fitting itself to a dataset. Both raise NotImplementedError here, so a subclass only overrides what it actually supports.

Methods

sample_x

This function samples a batch of data samples from the generator.

train_model

This function trains the generator.

abstract sample_x(batch_size=1)[source]

This function samples a batch of data samples from the generator. If not implemented, it will throw a NotImplementedError.

train_model()[source]

This function trains the generator. If not implemented, it will throw a NotImplementedError.