未验证 提交 c7a33b0b 编写于 作者: T Tao Luo 提交者: GitHub

Merge pull request #444 from PaddlePaddle/updateInferPy

Update the fit_a_line/infer.py to use the uci_housing.model
......@@ -7,12 +7,10 @@ paddle.init(use_gpu=False, trainer_count=1)
x = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(13))
y_predict = paddle.layer.fc(input=x, size=1, act=paddle.activation.Linear())
with open('fit_a_line.tar', 'r') as f:
parameters = paddle.parameters.Parameters.from_tar(f)
# Infer using provided test data.
probs = paddle.infer(
output_layer=y_predict, parameters=parameters,
output_layer=y_predict,
parameters=paddle.dataset.uci_housing.model(),
input=[item for item in paddle.dataset.uci_housing.test()()])
for i in xrange(len(probs)):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册