美文网首页
[Python]使用itertools.count来计数训练

[Python]使用itertools.count来计数训练

作者: VanJordan | 来源:发表于2019-03-31 13:33 被阅读0次
  • itertools.count(start,step)函数的意思是创建一个从start开始每次的步长是step的无穷序列
# At any point you can hit Ctrl + C to break out of training early.
try:
    for epoch in itertools.count(start=1):
        train()
        if train_step == args.max_step:
            logging('-' * 100)
            logging('End of training')
            break
except KeyboardInterrupt:
    logging('-' * 100)
    logging('Exiting from training early')

相关文章

网友评论

      本文标题:[Python]使用itertools.count来计数训练

      本文链接:https://www.haomeiwen.com/subject/izgybqtx.html