Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

numpy_input_fn

Construct Input Function Containing Python Dictionaries of Numpy Arrays


Description

This returns a function outputting features and target based on the dict of numpy arrays. The dict features has the same keys as the x.

Usage

numpy_input_fn(x, y = NULL, batch_size = 128, num_epochs = 1,
  shuffle = NULL, queue_capacity = 1000, num_threads = 1)

Arguments

x

dict of numpy array object.

y

numpy array object. NULL if absent.

batch_size

Integer, size of batches to return.

num_epochs

Integer, number of epochs to iterate over data. If NULL will run forever.

shuffle

Boolean, if TRUE shuffles the queue. Avoid shuffle at prediction time.

queue_capacity

Integer, size of queue to accumulate.

num_threads

Integer, number of threads used for reading and enqueueing. In order to have predicted and repeatable order of reading and enqueueing, such as in prediction and evaluation mode, num_threads should be 1. #'

Details

Note that this function is still experimental and should only be used if necessary, e.g. feed in data that's dictionary of numpy arrays.

Raises

ValueError: if the shape of y mismatches the shape of values in x (i.e., values in x have same shape). TypeError: x is not a dict or shuffle is not bool.

See Also

Other input functions: input_fn


tfestimators

Interface to 'TensorFlow' Estimators

v1.9.1
Apache License 2.0
Authors
JJ Allaire [aut], Yuan Tang [aut] (<https://orcid.org/0000-0001-5243-233X>), Kevin Ushey [aut], Kevin Kuo [aut, cre] (<https://orcid.org/0000-0001-7803-7901>), Daniel Falbel [ctb, cph], RStudio [cph, fnd], Google Inc. [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.