nami_toys.dataset#

Classes

ToyDataset(x[, y, meta])

Lightweight container for toy simulation data.

class nami_toys.dataset.ToyDataset(x, y=None, meta=<factory>)[source]#

Bases: object

Lightweight container for toy simulation data.

Parameters:
  • x (Tensor) – Data points with shape (N, d).

  • y (Tensor | None) – Optional integer labels with shape (N,).

  • meta (dict[str, Any]) – Metadata from the generation call.

limit(n)[source]#

Return a dataset containing at most n entries.

Return type:

ToyDataset

Parameters:

n (int)

meta: dict[str, Any]#
subset(mask)[source]#

Return a new dataset containing only entries where mask is True.

Return type:

ToyDataset

Parameters:

mask (Tensor)

x: Tensor#
y: Tensor | None = None#