【发布时间】:2017-04-28 15:29:56
【问题描述】:
我正在使用 Tensorflow,训练了一个很宽的网络,并且想要预测一些值。我使用了Tensorflow iris prediction example 之类的网络,但将预测部分从
new_samples = np.array([[6.4, 3.2, 4.5, 1.5], [5.8, 3.1, 5.0, 1.7]], dtype=float)
y = list(classifier.predict(new_samples, as_iterable=True))
在我自己的输入函数中从我的测试文件中读取数据的可能性:
y = list(classifier.predict(input_fn=lambda: input_fn(test_file_name, batch_size, batch_number)))
经过一些测试我发现预测顺序不是文件的数据顺序。如何强制 TensorFlow 输出正确修正的预测?作为另一种选择,我如何打印带有特征(和线的标签)的预测?
感谢您的支持。
【问题讨论】:
标签: python numpy machine-learning neural-network tensorflow