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
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}