def eval_input_fn(params): data = Data(dataset='WN18', reverse=True) validation_data = data.get_inputs_and_targets() ds = validation_data return ds
def predict_input_fn(params): batch_size = params["batch_size"] data = Data(dataset='WN18', reverse=True) test_data = data.get_inputs_and_targets() # Take out top 10 samples from test data to make the predictions. ds = test_data.take(10).batch(batch_size) return ds
def train_input_fn(params): """train_input_fn defines the input pipeline used for training.""" # Retrieves the batch size for the current shard. The # of shards is # computed according to the input pipeline deployment. See # `tf.contrib.tpu.RunConfig` for details. data = Data(dataset='WN18', reverse=True) train_data = data.get_inputs_and_targets(training=True) ds = train_data.shuffle(buffer_size=1000).repeat() return ds