MCPcopy Create free account
hub / github.com/TorchSSL/TorchSSL / update

Method update

train_utils.py:147–164  ·  view source on GitHub ↗

Args tb_dict: contains scalar values for updating tensorboard it: contains information of iteration (int). suffix: If not None, the update key has the suffix.

(self, tb_dict, it, suffix=None, mode="train")

Source from the content-addressed store, hash-verified

145 self.writer = CustomWriter(os.path.join(self.tb_dir, file_name))
146
147 def update(self, tb_dict, it, suffix=None, mode="train"):
148 """
149 Args
150 tb_dict: contains scalar values for updating tensorboard
151 it: contains information of iteration (int).
152 suffix: If not None, the update key has the suffix.
153 """
154 if suffix is None:
155 suffix = ''
156 if self.use_tensorboard:
157 for key, value in tb_dict.items():
158 self.writer.add_scalar(suffix + key, value, it)
159 else:
160 self.writer.set_epoch(it, mode)
161 for key, value in tb_dict.items():
162 self.writer.add_scalar(suffix + key, value)
163 self.writer.plot_stats()
164 self.writer.dump_stats()
165
166
167class AverageMeter(object):

Callers

nothing calls this directly

Calls 4

add_scalarMethod · 0.80
set_epochMethod · 0.80
plot_statsMethod · 0.80
dump_statsMethod · 0.80

Tested by

no test coverage detected