本文整理匯總了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
示例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
示例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