A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://diffengine.readthedocs.io/en/latest/autoapi/diffengine/datasets/samplers/index.html below:

Website Navigation


diffengine.datasets.samplers — diffengine 1.0.0 documentation

diffengine.datasets.samplers Submodules Package Contents Classes
class diffengine.datasets.samplers.AspectRatioBatchSampler(sampler, batch_size, bucket_ids=None, *, drop_last=False)[source]

Bases: torch.utils.data.BatchSampler

Aspect ratio batch sampler.

A sampler wrapper for grouping images with similar aspect ratio into a same batch.

Args:

sampler (Sampler): Base sampler. batch_size (int): Size of mini-batch. bucket_ids (str | None): The path of bucket ids. If None, the

bucket ids will be calculated automatically. Default: None.

drop_last (bool): If True, the sampler will drop the last batch if

its size would be less than batch_size.

__iter__()[source]

Get the iterator of the sampler.

Return type:

collections.abc.Generator

__len__()[source]

Get the length of the sampler.

Return type:

int

Parameters:
  • sampler (torch.utils.data.Sampler) –

  • batch_size (int) –

  • bucket_ids (str | None) –

  • drop_last (bool) –


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4