spine.io.sample

Used to define which dataset entries to load at each iteration

Classes

AbstractBatchSampler(dataset, batch_size[, ...])

Abstract sampler class.

AbstractJointBatchSampler(dataset, batch_size)

Pair primary sampler indices with independently sampled secondary indices.

BootstrapBatchSampler(dataset, batch_size[, ...])

Sampler used for bootstrap sampling of the entire dataset.

DistributedProxySampler(sampler, ...)

Sampler that restricts data loading to a subset of input sampler indices.

DistributedSampler(*args, **kwargs)

Import-safe stand-in used when PyTorch is unavailable.

JointBootstrapBatchSampler(dataset, batch_size)

Bootstrap primary sampling with paired bootstrap secondary sampling.

JointRandomSequenceBatchSampler(dataset, ...)

Random-sequence primary sampling with paired random secondary sampling.

JointSequentialBatchSampler(dataset, batch_size)

Sequential primary sampling with paired sequential secondary sampling.

RandomSequenceBatchSampler(dataset, batch_size)

Samples sequential batches randomly within the dataset.

Sampler(*args, **kwargs)

Import-safe stand-in used when PyTorch is unavailable.

SequentialBatchSampler(dataset, batch_size)

Samples batches sequentially within the dataset.

class spine.io.sample.SequentialBatchSampler(dataset: Sized, batch_size: int, seed: int | None = None, drop_last: bool = True)[source]

Samples batches sequentially within the dataset.

name = 'sequential'
class spine.io.sample.RandomSequenceBatchSampler(dataset: Sized, batch_size: int, seed: int | None = None, drop_last: bool = True)[source]

Samples sequential batches randomly within the dataset.

name = 'random_sequence'
class spine.io.sample.BootstrapBatchSampler(dataset: Sized, batch_size: int, seed: int | None = None, drop_last: bool = True)[source]

Sampler used for bootstrap sampling of the entire dataset.

This is particularly useful for training an ensemble of networks (bagging).

name = 'bootstrap'
class spine.io.sample.JointSequentialBatchSampler(dataset: Sized, batch_size: int, seed: int | None = None, drop_last: bool = True, pair_probability: float = 1.0)[source]

Sequential primary sampling with paired sequential secondary sampling.

Methods

sampler_cls

name = 'joint_sequential'
sampler_cls

alias of SequentialBatchSampler

class spine.io.sample.JointRandomSequenceBatchSampler(dataset: Sized, batch_size: int, seed: int | None = None, drop_last: bool = True, pair_probability: float = 1.0)[source]

Random-sequence primary sampling with paired random secondary sampling.

Methods

sampler_cls

name = 'joint_random_sequence'
sampler_cls

alias of RandomSequenceBatchSampler

class spine.io.sample.JointBootstrapBatchSampler(dataset: Sized, batch_size: int, seed: int | None = None, drop_last: bool = True, pair_probability: float = 1.0)[source]

Bootstrap primary sampling with paired bootstrap secondary sampling.

Methods

sampler_cls

name = 'joint_bootstrap'
sampler_cls

alias of BootstrapBatchSampler