当前位置: 首页>>代码示例>>Python>>正文


Python constants.MAX_TIME_STEP属性代码示例

本文整理汇总了Python中constants.MAX_TIME_STEP属性的典型用法代码示例。如果您正苦于以下问题:Python constants.MAX_TIME_STEP属性的具体用法?Python constants.MAX_TIME_STEP怎么用?Python constants.MAX_TIME_STEP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在constants的用法示例。


在下文中一共展示了constants.MAX_TIME_STEP属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: train_function

# 需要导入模块: import constants [as 别名]
# 或者: from constants import MAX_TIME_STEP [as 别名]
def train_function(parallel_index):
    global global_t
    training_thread = training_threads[parallel_index]
    last_global_t = 0

    scene, task = branches[parallel_index % NUM_TASKS]
    key = scene + "-" + task

    while global_t < MAX_TIME_STEP and not stop_requested:
      diff_global_t = training_thread.process(sess, global_t, summary_writer,
                                              summary_op[key], summary_placeholders[key])
      global_t += diff_global_t
      # periodically save checkpoints to disk
      if parallel_index == 0 and global_t - last_global_t > 1000000:
        print('Save checkpoint at timestamp %d' % global_t)
        saver.save(sess, CHECKPOINT_DIR + '/' + 'checkpoint', global_step = global_t)
        last_global_t = global_t 
开发者ID:yushu-liu,项目名称:icra2017-visual-navigation,代码行数:19,代码来源:train.py

示例2: train_function

# 需要导入模块: import constants [as 别名]
# 或者: from constants import MAX_TIME_STEP [as 别名]
def train_function(parallel_index):
  global global_t
  
  training_thread = training_threads[parallel_index]
  # set start_time
  start_time = time.time() - wall_t
  training_thread.set_start_time(start_time)

  while True:
    if stop_requested:
      break
    if global_t > MAX_TIME_STEP:
      break

    diff_global_t = training_thread.process(sess, global_t, summary_writer,
                                            summary_op, score_input)
    global_t += diff_global_t 
开发者ID:miyosuda,项目名称:async_deep_reinforce,代码行数:19,代码来源:a3c.py

示例3: train_function

# 需要导入模块: import constants [as 别名]
# 或者: from constants import MAX_TIME_STEP [as 别名]
def train_function(parallel_index):
  global global_t
  
  training_thread = training_threads[parallel_index]
  # set start_time
  start_time = time.time() - wall_t
  training_thread.set_start_time(start_time)
  idx=1;total_score=0;
  while True:
    if stop_requested:
      break
    if global_t > MAX_TIME_STEP:
      break

    diff_global_t,score = training_thread.process(sess, global_t, summary_writer,
                                            summary_op, score_input)
    if(idx==100):
        total_score+=score;
        total_score=total_score/100.;
        print("Score: "+str(total_score));
        idx=1;
    else:
        total_score+=score;
        idx+=1;

    global_t += diff_global_t 
开发者ID:jsikyoon,项目名称:a3c-distributed_tensorflow,代码行数:28,代码来源:a3c.py


注:本文中的constants.MAX_TIME_STEP属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。