kd.data.py

Contents

kd.data.py#

[[Source]]

PyGrain public API.

Symbols#

Class#

kd.data.py.AddConstants

Adds constant elements.

kd.data.py.Cast

Cast an element to the specified dtype.

kd.data.py.CenterCrop

Crop the input data to the specified shape from the center.

kd.data.py.DataSource

Generic loader of arbitrary grain data source.

kd.data.py.DataSourceBase

Base class to implement a data source.

kd.data.py.ElementWiseRandomTransform

Base class for elementwise transforms.

kd.data.py.ElementWiseTransform

Base class for elementwise transforms.

kd.data.py.Elements

Modify the elements by keeping xor dropping and/or renaming and/or copying.

kd.data.py.Gather

Gathers entries along a single dimension.

kd.data.py.HuggingFace

HuggingFace loader.

kd.data.py.Json

Json pipeline.

kd.data.py.Mix

Create a dataset mixture from given weights.

kd.data.py.PyGrainPipeline

Abstract base class to construct PyGrain data pipeline.

kd.data.py.RandomCrop

Randomly crop the input data to the specified shape.

kd.data.py.RandomFlipLeftRight

Flips an image horizontally with probability 50%.

kd.data.py.Rearrange

Einops rearrange on a single element.

kd.data.py.Resize

Resizes an image.

kd.data.py.SelectFromDatasets

Create a dataset mixture using a selection map.

kd.data.py.SliceDataset

Transform which select a subset of the dataset.

kd.data.py.Tfds

Base TFDS loader.

kd.data.py.TreeFlattenWithPath

Flatten any tree-structured elements.

kd.data.py.ValueRange

Map the value range of an element.