mirror of
https://github.com/clearml/clearml
synced 2025-04-08 22:54:44 +00:00
Change tensorboard default scalar grouping (now False)
This commit is contained in:
parent
0cbc99b16d
commit
44ffb2985d
@ -238,7 +238,9 @@ class EventTrainsWriter(object):
|
||||
return self._add_image_numpy(tag=tag, step=step, img_data_np=matrix)
|
||||
|
||||
def _add_scalar(self, tag, step, scalar_data):
|
||||
title, series = self.tag_splitter(tag, num_split_parts=1, default_title='Scalars', logdir_header='series_last')
|
||||
default_title = tag if not self._logger._get_tensorboard_auto_group_scalars() else 'Scalars'
|
||||
title, series = self.tag_splitter(tag, num_split_parts=1,
|
||||
default_title=default_title, logdir_header='series_last')
|
||||
|
||||
# update scalar cache
|
||||
num, value = self._scalar_report_cache.get((title, series), (0, 0))
|
||||
|
@ -23,6 +23,7 @@ class Logger(object):
|
||||
**Usage:** :func:`Logger.current_logger` or :func:`Task.get_logger`
|
||||
"""
|
||||
SeriesInfo = SeriesInfo
|
||||
_tensorboard_logging_auto_group_scalars = False
|
||||
|
||||
def __init__(self, private_task):
|
||||
"""
|
||||
@ -444,6 +445,15 @@ class Logger(object):
|
||||
self.report_image(title=title, series=series, iteration=iteration, local_path=path, matrix=matrix,
|
||||
max_image_history=max_image_history, delete_after_upload=delete_after_upload)
|
||||
|
||||
@classmethod
|
||||
def tensorboard_auto_group_scalars(cls, group_scalars=False):
|
||||
"""
|
||||
If `group_scalars` set to True, we preserve backward compatible Tensorboard auto-magic behaviour,
|
||||
i.e. Scalars without specific title will be grouped under the "Scalars" graph.
|
||||
Default is False: Tensorboard scalars without title will have title/series with the same tag
|
||||
"""
|
||||
cls._tensorboard_logging_auto_group_scalars = group_scalars
|
||||
|
||||
@classmethod
|
||||
def _remove_std_logger(cls):
|
||||
StdStreamPatch.remove_std_logger()
|
||||
@ -595,3 +605,12 @@ class Logger(object):
|
||||
def _flush_stdout_handler(self):
|
||||
if self._task_handler and DevWorker.report_stdout:
|
||||
self._task_handler.flush()
|
||||
|
||||
@classmethod
|
||||
def _get_tensorboard_auto_group_scalars(cls):
|
||||
"""
|
||||
:return: return True if we preserve Tensorboard backward compatibility behaviour,
|
||||
i.e. Scalars without specific title will be under the "Scalars" graph
|
||||
default is False: Tensorboard scalars without title will have title/series with the same tag
|
||||
"""
|
||||
return cls._tensorboard_logging_auto_group_scalars
|
||||
|
Loading…
Reference in New Issue
Block a user