Created
February 3, 2018 15:19
-
-
Save NMZivkovic/c428e674d9d10b618080b3d8c15fbbc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define evaluation function | |
def evaluation_function(attributes, classes, batch_size): | |
attributes=dict(attributes) | |
if classes is None: | |
inputs = attributes | |
else: | |
inputs = (attributes, classes) | |
dataset = tf.data.Dataset.from_tensor_slices(inputs) | |
assert batch_size is not None, "batch_size must not be None" | |
dataset = dataset.batch(batch_size) | |
return dataset.make_one_shot_iterator().get_next() | |
# Evaluate the model. | |
eval_result = classifier.evaluate( | |
input_fn=lambda:evaluation_function(test_x, test_y, 100)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment