Base class for generative models

Generative Models

GenerativeModel is a base class that defines the functions a model needs to integrate with the MRL library

class GenerativeModel[source]

GenerativeModel() :: Module

GenerativeModel - base generative model class

beam_search(model, seed_ints, k, beam_size, sl, temperature, pad_idx=None)

beam_search - perform beam search using model

Inputs:

  • model nn.Module: model

  • seed_ints torch.Longtensor: seed sequence

  • k int: top k beam sampling

  • beam_size int: maximum number of beams to retain

  • sl int: max sequence length

  • temperature float: sample temperature

  • pad_idx Optional[int]: pad index if applicable