Wil*_*son 2 machine-learning tensorflow
我在tensorflow网站上找到了一些示例代码,如下所示.
input_fn = tf.contrib.learn.io.numpy_input_fn({"x":x_train}, y_train, batch_size=4, num_epochs=1000)
eval_input_fn = tf.contrib.learn.io.numpy_input_fn({"x":x_eval}, y_eval, batch_size=4, num_epochs=1000)
# We can invoke 1000 training steps by invoking the method and passing the
# training data set.
estimator.fit(input_fn=input_fn, steps=1000)
# Here we evaluate how well our model did.
train_loss = estimator.evaluate(input_fn=input_fn)
eval_loss = estimator.evaluate(input_fn=eval_input_fn)
print("train loss: %r"% train_loss)
print("eval loss: %r"% eval_loss)
Run Code Online (Sandbox Code Playgroud)
你能告诉我"训练损失"的含义吗?
| 归档时间: |
|
| 查看次数: |
1133 次 |
| 最近记录: |