1179e6e7b0caf883b32c4f466208e3373450c1d2,imdb/keras/trainer/model.py,,input_fn,#Any#Any#Any#Any#,64
Before Change
// Default settings for training
num_epochs = None
shuffle = True
// Override if this is eval
if mode == tf.estimator.ModeKeys.EVAL:
num_epochs = 1
shuffle = False
y = np.asarray(y).astype("int").reshape((-1, 1))
return tf.estimator.inputs.numpy_input_fn(
x,
y=y,
batch_size=batch_size,
num_epochs=num_epochs,
shuffle=shuffle,
queue_capacity=50000)
def serving_input_fn():
Defines the features to be passed to the model during inference.
After Change
A tf.estimator.
// Default settings for training.
if labels is None:
inputs = features
else:
labels = np.asarray(labels).astype("int").reshape((-1, 1))
inputs = (features, labels)
// Convert the inputs to a Dataset.
dataset = tf.data.Dataset.from_tensor_slices(inputs)
if mode == tf.estimator.ModeKeys.TRAIN:
dataset = dataset.shuffle(1000).repeat().batch(batch_size)
if mode == tf.estimator.ModeKeys.EVAL:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: GoogleCloudPlatform/cloudml-samples
Commit Name: 1179e6e7b0caf883b32c4f466208e3373450c1d2
Time: 2018-10-15
Author: gogasca@google.com
File Name: imdb/keras/trainer/model.py
Class Name:
Method Name: input_fn
Project Name: GoogleCloudPlatform/cloudml-samples
Commit Name: b198dc46455cc467759b9d8b51c37809ec6248e0
Time: 2018-10-20
Author: gogasca@google.com
File Name: boston/keras/trainer/model.py
Class Name:
Method Name: input_fn
Project Name: tensorflow/privacy
Commit Name: 10335f61775faabe5e931f30b0ecf91f0719b727
Time: 2020-05-07
Author: schien@google.com
File Name: tutorials/mnist_dpsgd_tutorial.py
Class Name:
Method Name: main