rime.util.score_array.LazyScoreBase

class rime.util.score_array.LazyScoreBase(shape)[source]

Bases: object

low-rank, sparse, and other expressions with deferred evaluations after subsampling

  • Support expressions like (a @ b.T + c).exp() * d + e

  • Support operations T, __getitem__, collate_fn

  • Lazy evaluation until as_tensor(device) or numpy()

Drop support for reindex because it is nontrivial to find fill_values through activation.

__init__(shape)[source]

Methods

__init__(shape)

apply(op)

as_tensor([device])

collate_fn(D)

collate by rows for pytorch dataloaders

exp()

numpy()

sigmoid()

softplus()

vae_module(module)

Attributes

T

batch_size

size

static collate_fn(D)[source]

collate by rows for pytorch dataloaders