

SummaryWriter
class SummaryWriter(object):
def __init__(self, log_dir=None, comment='', purge_step=None, max_queue=10,flush_secs=120, filename_suffix='')
功能:
提供创建event file的高级接口
主要属性:
- log_dir: event_file输出文件夹
- comment: 不指定 log_dir时,文件后缀
- filename_suffix:event file文件名后缀
add_scalar and add_histogram
add_scalar()
add_scalar(tag, scalar_value, global_step=None, walltime=None)
功能: 记录标量
- tag: 图像的标签名,图的唯一标识
- scalar_value: 要记录的标量
- global_step: x轴
add_scalars()
add_scalars(main_tag, tag_scalar_dict, global_step=None, walltime=None)
- main_tag: 该图的标签
- tag_scalar_dict: key是变量的tag,value是变量的值
add_histogram()
add_histogram(tag, values, global_step=None, bins='tensorflow', walltime=None)
功能:统计直方图与多分位数折线图
- tag: 图像的标签名,图的唯一标识
- values:要统计的参数
- global_step:y轴
- bins:取直方图的bins
本文详细介绍了TensorFlow中SummaryWriter类的功能与使用方法,包括如何创建event file,记录标量数据,统计直方图和多分位数折线图。通过实例解析了add_scalar(), add_scalars()和add_histogram()等关键函数的参数与作用。

被折叠的 条评论
为什么被折叠?



