Create a small table using the keys of small_dict as headers. This is only suitable for small dictionaries. Args: small_dict (dict): a result dictionary of only a few items. Returns: str: the table as a string.
(small_dict)
| 381 | # Misc # |
| 382 | # -------------------------------------------------------- # |
| 383 | def create_small_table(small_dict): |
| 384 | """ |
| 385 | Create a small table using the keys of small_dict as headers. This is only |
| 386 | suitable for small dictionaries. |
| 387 | |
| 388 | Args: |
| 389 | small_dict (dict): a result dictionary of only a few items. |
| 390 | |
| 391 | Returns: |
| 392 | str: the table as a string. |
| 393 | """ |
| 394 | keys, values = tuple(zip(*small_dict.items())) |
| 395 | table = tabulate( |
| 396 | [values], |
| 397 | headers=keys, |
| 398 | tablefmt="pipe", |
| 399 | floatfmt=".3f", |
| 400 | stralign="center", |
| 401 | numalign="center", |
| 402 | ) |
| 403 | return table |
| 404 | |
| 405 | |
| 406 | def warmup_lr_scheduler(optimizer, warmup_iters, warmup_factor): |