當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。