module training.data_loader#

Inheritance diagram of onnxcustom.training.data_loader

Short summary#

module onnxcustom.training.data_loader

Manipulate data for training.

source on GitHub

Classes#

class

truncated documentation

OrtDataLoader

Draws consecutive random observations from a dataset by batch. It iterates over the datasets by drawing batch_size

Properties#

property

truncated documentation

data_np

Returns a tuple of the datasets in numpy.

data_ort

Returns a tuple of the datasets in onnxruntime C_OrtValue.

Methods#

method

truncated documentation

__getstate__

Removes any non pickable attribute.

__init__

__len__

Returns the number of observations.

__repr__

usual

__setstate__

Restores any non pickable attribute.

_next_iter

iter_bind

Iterates over the datasets by drawing batch_size consecutive observations. Modifies a bind structure.

iter_numpy

Iterates over the datasets by drawing batch_size consecutive observations. This iterator is slow as it …

iter_ortvalue

Iterates over the datasets by drawing batch_size consecutive observations. This iterator is slow as it …

Documentation#

Manipulate data for training.

source on GitHub

class onnxcustom.training.data_loader.OrtDataLoader(X, y, sample_weight=None, batch_size=20, device='cpu', random_iter=True)#

Bases: object

Draws consecutive random observations from a dataset by batch. It iterates over the datasets by drawing batch_size consecutive observations.

Parameters
  • X – features

  • y – labels

  • sample_weight – weight or None

  • batch_size – batch size (consecutive observations)

  • deviceC_OrtDevice or a string such as ‘cpu’

  • random_iter – random iteration

See example Train a scikit-learn neural network with onnxruntime-training on GPU.

source on GitHub

__getstate__()#

Removes any non pickable attribute.

__init__(X, y, sample_weight=None, batch_size=20, device='cpu', random_iter=True)#
__len__()#

Returns the number of observations.

__repr__()#

usual

__setstate__(state)#

Restores any non pickable attribute.

_next_iter(previous)#
property data_np#

Returns a tuple of the datasets in numpy.

property data_ort#

Returns a tuple of the datasets in onnxruntime C_OrtValue.

iter_bind(bind, names)#

Iterates over the datasets by drawing batch_size consecutive observations. Modifies a bind structure.

source on GitHub

iter_numpy()#

Iterates over the datasets by drawing batch_size consecutive observations. This iterator is slow as it copies the data of every batch. The function yields C_OrtValue.

source on GitHub

iter_ortvalue()#

Iterates over the datasets by drawing batch_size consecutive observations. This iterator is slow as it copies the data of every batch. The function yields C_OrtValue.

source on GitHub