neon.data.hdf5iterator.HDF5IteratorAutoencoder

class neon.data.hdf5iterator.HDF5IteratorAutoencoder(hdf_filename, name=None)[source]

Bases: neon.data.hdf5iterator.HDF5Iterator

Extends the base HDF5Iterator class for an autoencoder model. Returns the input data as the target.

__init__(hdf_filename, name=None)
Parameters:
  • hdf_filename (string) – Path to the HDF5 datafile.
  • name (string, optional) – Name to assign this iterator. Defaults to None.

Methods

__init__(hdf_filename[, name])
param hdf_filename:
 Path to the HDF5 datafile.
allocate() After the input and output (self.inp and self.out) have been set this function will allocate the host and device buffers for the mini-batches.
allocate_inputs() Allocates the host and device input data buffers and any other associated storage.
allocate_outputs() Allocates the host and device output data buffers and any other associated storage.
cleanup() Closes the HDF file.
gen_class(pdict)
gen_input(mini_batch) Function to handle any preprocessing before pushing an input mini-batch to the device.
gen_output(mini_batch) Function to handle any preprocessing before pushing an output mini-batch to the device.
get_description([skip]) Returns a dict that contains all necessary information needed to serialize this object.
recursive_gen(pdict, key) helper method to check whether the definition
reset() Resets the index to zero.
allocate()

After the input and output (self.inp and self.out) have been set this function will allocate the host and device buffers for the mini-batches.

The host buffer is referenced as self.mini_batch_in and self.mini_batch_out, and stored on device as self.inbuf and self.outbuf.

allocate_inputs()

Allocates the host and device input data buffers and any other associated storage.

self.inpbuf is the on-device buffer for the input minibatch self.mini_batch_in is the on-host buffer for the input minibatch self.mean is the on-device buffer of the mean array

allocate_outputs()

Allocates the host and device output data buffers and any other associated storage.

self.outbuf is the on-device buffer for the output minibatch self.mini_batch_out is the on-host buffer for the output minibatch

be = None
classnm

Returns the class name.

cleanup()

Closes the HDF file.

gen_class(pdict)
gen_input(mini_batch)

Function to handle any preprocessing before pushing an input mini-batch to the device. For example, mean subtraction etc.

Parameters:mini_batch (ndarray) – M-by-N array where M is the flatten input vector size and N is the batch size
gen_output(mini_batch)

Function to handle any preprocessing before pushing an output mini-batch to the device. For example, one-hot generation.

Parameters:mini_batch (ndarray) – M-by-N array where M is the flatten output vector size and N is the batch size
get_description(skip=[], **kwargs)

Returns a dict that contains all necessary information needed to serialize this object.

Parameters:skip (list) – Objects to omit from the dictionary.
Returns:Dictionary format for object information.
Return type:(dict)
modulenm

Returns the full module path.

nbatches

Return the number of minibatches in this dataset.

recursive_gen(pdict, key)

helper method to check whether the definition dictionary is defining a NervanaObject child, if so it will instantiate that object and replace the dictionary element with an instance of that object

reset()

Resets the index to zero.