pescador.maps.keras_tuples

pescador.maps.keras_tuples(stream, inputs=None, outputs=None)

Reformat data objects as keras-compatible tuples.

For more detail: https://keras.io/models/model/#fit

Parameters:
stream : iterable

Stream of data objects.

inputs : string or iterable of strings, None

Keys to use for ordered input data. If not specified, returns None in its place.

outputs : string or iterable of strings, default=None

Keys to use for ordered output data. If not specified, returns None in its place.

Yields:
x : np.ndarray, list of np.ndarray, or None

If inputs is a string, x is a single np.ndarray. If inputs is an iterable of strings, x is a list of np.ndarrays. If inputs is a null type, x is None.

y : np.ndarray, list of np.ndarray, or None

If outputs is a string, y is a single np.ndarray. If outputs is an iterable of strings, y is a list of np.ndarrays. If outputs is a null type, y is None.

Raises:
DataError

If the stream contains items that are not data-like.