本文整理汇总了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