module training.data_loader
#
Short summary#
module onnxcustom.training.data_loader
Manipulate data for training.
Classes#
class |
truncated documentation |
---|---|
Draws consecutive random observations from a dataset by batch. It iterates over the datasets by drawing batch_size … |
Properties#
property |
truncated documentation |
---|---|
Returns a tuple of the datasets in numpy. |
|
Returns a tuple of the datasets in onnxruntime C_OrtValue. |
Methods#
method |
truncated documentation |
---|---|
Removes any non pickable attribute. |
|
Returns the number of observations. |
|
usual |
|
Restores any non pickable attribute. |
|
Iterates over the datasets by drawing batch_size consecutive observations. Modifies a bind structure. |
|
Iterates over the datasets by drawing batch_size consecutive observations. This iterator is slow as it … |
|
Iterates over the datasets by drawing batch_size consecutive observations. This iterator is slow as it … |
Documentation#
Manipulate data for training.
- 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)
device – C_OrtDevice or a string such as ‘cpu’
random_iter – random iteration
See example Train a scikit-learn neural network with onnxruntime-training on GPU.
- __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.
- 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.
- 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.