| 189 | |
| 190 | |
| 191 | def summarize( |
| 192 | writer, |
| 193 | global_step, |
| 194 | scalars={}, |
| 195 | histograms={}, |
| 196 | images={}, |
| 197 | audios={}, |
| 198 | audio_sampling_rate=22050, |
| 199 | ): |
| 200 | for k, v in scalars.items(): |
| 201 | writer.add_scalar(k, v, global_step) |
| 202 | for k, v in histograms.items(): |
| 203 | writer.add_histogram(k, v, global_step) |
| 204 | for k, v in images.items(): |
| 205 | writer.add_image(k, v, global_step, dataformats="HWC") |
| 206 | for k, v in audios.items(): |
| 207 | writer.add_audio(k, v, global_step, audio_sampling_rate) |
| 208 | |
| 209 | |
| 210 | def latest_checkpoint_path(dir_path, regex="G_*.pth"): |