neuralmonkey.readers package


neuralmonkey.readers.audio_reader module

neuralmonkey.readers.image_reader module

neuralmonkey.readers.image_reader.image_reader(prefix='', pad_w: typing.Union[int, NoneType] = None, pad_h: typing.Union[int, NoneType] = None, rescale: bool = False, mode: str = 'RGB') → typing.Callable

Get a reader of images loading them from a list of pahts.

  • prefix – Prefix of the paths that are listed in a image files.
  • pad_w – Width to which the images will be padded/cropped/resized.
  • pad_h – Height to with the images will be padded/corpped/resized.
  • rescale – If true, bigger images will be rescaled to the pad_w x pad_h size. Otherwise, they will be cropped from the middle.
  • mode – Scipy image loading mode, see scipy documentation for more details.

The reader function that takes a list of image paths (relative to provided prefix) and returns a list of images as numpy arrays of shape pad_h x pad_w x number of channels.

neuralmonkey.readers.image_reader.imagenet_reader(prefix: str, target_width: int = 227, target_height: int = 227) → typing.Callable

Load and prepare image the same way as Caffe scripts.

neuralmonkey.readers.numpy_reader module

neuralmonkey.readers.numpy_reader.numpy_reader(files: typing.List[str])

neuralmonkey.readers.plain_text_reader module

neuralmonkey.readers.plain_text_reader.UtfPlainTextReader(files: typing.List[str]) → typing.Iterable[typing.List[str]]
neuralmonkey.readers.plain_text_reader.get_plain_text_reader(encoding: str = 'utf-8')

Get reader for space-separated tokenized text.

neuralmonkey.readers.string_vector_reader module

neuralmonkey.readers.string_vector_reader.FloatVectorReader(files: typing.List[str]) → typing.Iterable[typing.List[numpy.ndarray]]
neuralmonkey.readers.string_vector_reader.IntVectorReader(files: typing.List[str]) → typing.Iterable[typing.List[numpy.ndarray]]
neuralmonkey.readers.string_vector_reader.get_string_vector_reader(dtype: typing.Type = <class 'numpy.float32'>, columns: int = None)

Get a reader for vectors encoded as whitespace-separated numbers

neuralmonkey.readers.utils module

Module contents