Class HDF5Matrix
Defined in tensorflow/python/keras/utils/io_utils.py
.
Representation of HDF5 dataset to be used instead of a Numpy array.
Example:
x_data = HDF5Matrix('input/file.hdf5', 'data')
model.predict(x_data)
Providing start
and end
allows use of a slice of the dataset.
Optionally, a normalizer function (or lambda) can be given. This will be called on every slice of data retrieved.
Arguments:
datapath
: string, path to a HDF5 filedataset
: string, name of the HDF5 dataset in the file specified in datapathstart
: int, start of desired slice of the specified datasetend
: int, end of desired slice of the specified datasetnormalizer
: function to be called on data when retrieved
Returns:
An array-like HDF5 dataset.
__init__
__init__(
datapath,
dataset,
start=0,
end=None,
normalizer=None
)
Initialize self. See help(type(self)) for accurate signature.
Properties
dtype
Gets the datatype of the dataset.
Returns:
A numpy dtype string.
ndim
Gets the number of dimensions (rank) of the dataset.
Returns:
An integer denoting the number of dimensions (rank) of the dataset.
shape
Gets a numpy-style shape tuple giving the dataset dimensions.
Returns:
A numpy-style shape tuple.
size
Gets the total dataset size (number of elements).
Returns:
An integer denoting the number of elements in the dataset.
Methods
tf.keras.utils.HDF5Matrix.__getitem__
__getitem__(key)
tf.keras.utils.HDF5Matrix.__len__
__len__()