本文整理匯總了Python中tfcode.nav_utils.add_default_summaries方法的典型用法代碼示例。如果您正苦於以下問題:Python nav_utils.add_default_summaries方法的具體用法?Python nav_utils.add_default_summaries怎麽用?Python nav_utils.add_default_summaries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tfcode.nav_utils
的用法示例。
在下文中一共展示了nav_utils.add_default_summaries方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _add_summaries
# 需要導入模塊: from tfcode import nav_utils [as 別名]
# 或者: from tfcode.nav_utils import add_default_summaries [as 別名]
def _add_summaries(m, args, summary_mode, arop_full_summary_iters):
task_params = args.navtask.task_params
summarize_ops = [m.lr_op, m.global_step_op, m.sample_gt_prob_op] + \
m.loss_ops + m.acc_ops
summarize_names = ['lr', 'global_step', 'sample_gt_prob_op'] + \
m.loss_ops_names + ['acc_{:d}'.format(i) for i in range(len(m.acc_ops))]
to_aggregate = [0, 0, 0] + [1]*len(m.loss_ops_names) + [1]*len(m.acc_ops)
scope_name = 'summary'
with tf.name_scope(scope_name):
s_ops = nu.add_default_summaries(summary_mode, arop_full_summary_iters,
summarize_ops, summarize_names,
to_aggregate, m.action_prob_op,
m.input_tensors, scope_name=scope_name)
if summary_mode == 'val':
arop, arop_summary_iters, arop_eval_fns = _summary_vis(
m, task_params.batch_size, task_params.num_steps,
arop_full_summary_iters)
s_ops.additional_return_ops += arop
s_ops.arop_summary_iters += arop_summary_iters
s_ops.arop_eval_fns += arop_eval_fns
if args.arch.readout_maps:
arop, arop_summary_iters, arop_eval_fns = _summary_readout_maps(
m, task_params.num_steps, arop_full_summary_iters)
s_ops.additional_return_ops += arop
s_ops.arop_summary_iters += arop_summary_iters
s_ops.arop_eval_fns += arop_eval_fns
return s_ops
示例2: _add_summaries
# 需要導入模塊: from tfcode import nav_utils [as 別名]
# 或者: from tfcode.nav_utils import add_default_summaries [as 別名]
def _add_summaries(m, summary_mode, arop_full_summary_iters):
summarize_ops = [m.lr_op, m.global_step_op, m.sample_gt_prob_op,
m.total_loss_op, m.data_loss_op, m.reg_loss_op] + m.acc_ops
summarize_names = ['lr', 'global_step', 'sample_gt_prob_op', 'total_loss',
'data_loss', 'reg_loss'] + \
['acc_{:d}'.format(i) for i in range(len(m.acc_ops))]
to_aggregate = [0, 0, 0, 1, 1, 1] + [1]*len(m.acc_ops)
scope_name = 'summary'
with tf.name_scope(scope_name):
s_ops = nu.add_default_summaries(summary_mode, arop_full_summary_iters,
summarize_ops, summarize_names,
to_aggregate, m.action_prob_op,
m.input_tensors, scope_name=scope_name)
m.summary_ops = {summary_mode: s_ops}