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")
| 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 | |
| 167 | class AverageMeter(object): |
nothing calls this directly
no test coverage detected