Created
October 21, 2017 10:57
-
-
Save AtsushiSuzuki/831b522fcbb1ec6ef2304997feb98005 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
import tensorflow as tf | |
import numpy as np | |
x = np.array([1., 2., 3., 4.]) | |
y = np.array([0., -1., -2, -3]) | |
fn = tf.estimator.inputs.numpy_input_fn( | |
{"x": x}, y, batch_size=4, num_epochs=None, shuffle=True) | |
sess = tf.Session() | |
features, target = fn() | |
for name in features: | |
print(str.format("feature {}: {}", name, sess.run(features[name]))) | |
print(str.format("target: {}", sess.run(target))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment