gfn.containers.base

Module Contents

Classes

Container

Base class for states containers (states, transitions, or trajectories).

class gfn.containers.base.Container

Bases: abc.ABC

Base class for states containers (states, transitions, or trajectories).

abstract __getitem__(index)

Subsets the container.

Parameters

index (int | Sequence[int]) –

Return type

Container

abstract __len__()

Returns the number of elements in the container.

Return type

int

abstract extend(other)

Extends the current container

Parameters

other (Container) –

Return type

None

load(path)

Loads the container from a file, overwriting the current container.

Parameters

path (str) –

Return type

None

sample(n_samples)

Samples a subset of the container.

Parameters

n_samples (int) –

Return type

Container

save(path)

Saves the container to a file.

Parameters

path (str) –

Return type

None