本文整理汇总了Python中interface.Interface.train方法的典型用法代码示例。如果您正苦于以下问题:Python Interface.train方法的具体用法?Python Interface.train怎么用?Python Interface.train使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类interface.Interface
的用法示例。
在下文中一共展示了Interface.train方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from interface import Interface [as 别名]
# 或者: from interface.Interface import train [as 别名]
if self.step % self.summary_step_period == 0:
writer.add_summary(summaries, self.step)
print('Step %d: Loss per pixel = %.5f (%.3f sec / step)' % (self.step, loss, duration))
self.step += 1
# Handle interface messages from the user.
self.interface_handler()
except tf.errors.OutOfRangeError:
if self.step == 0:
print('Training data not found.')
else:
print('Done training for %d epochs, %d steps.' % (self.number_of_epochs, self.step))
finally:
# When done, ask the threads to stop.
coordinator.request_stop()
# Wait for threads to finish.
coordinator.join(threads)
self.session.close()
def run(self):
"""
Allow for training the network from a multiprocessing standpoint.
"""
self.train()
if __name__ == '__main__':
interface = Interface(network_class=GoNet)
interface.train()