tf.contrib.learn.BaseEstimator.evaluate(): What is the meaning of the “steps” parameter?

社会主义新天地 提交于 2019-12-24 08:56:20

问题


According to https://www.tensorflow.org/versions/r0.9/api_docs/python/contrib.learn.html, the tf.contrib.learn.BaseEstimator.evaluate function can take in a steps parameter. The parameter is explained as follows:

steps: Number of steps for which to evaluate model. If None, evaluate forever.

How can evaluation have steps? In my understanding, a trained model should be "evaluated" only once (i.e. steps=1), and then calculate the loss against the target labels, right?

Thanks!


回答1:


You can also run the trained model on a function that generates data. In which case you can generate an infinite amount of data and don't want to run your evaluation forever. (You can also have a lot of data and small batch size so again it'll take too long). In either case you want to only evaluate the model for some sample of the population.



来源:https://stackoverflow.com/questions/39985025/tf-contrib-learn-baseestimator-evaluate-what-is-the-meaning-of-the-steps-pa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!