Inv mapping func. Args: label: TODO. mapping_dict: TODO.
(self, label, mapping_dict)
| 132 | print("Valid cost time ... ", ud_valid) |
| 133 | |
| 134 | def inv_mapping_func(self, label, mapping_dict): |
| 135 | """Inv mapping func. |
| 136 | |
| 137 | Args: |
| 138 | label: TODO. |
| 139 | mapping_dict: TODO. |
| 140 | """ |
| 141 | if not isinstance(label, int): |
| 142 | label = int(label) |
| 143 | if label in mapping_dict["label2dec"].keys(): |
| 144 | num = mapping_dict["label2dec"][label] |
| 145 | else: |
| 146 | num = -1 |
| 147 | return num |
| 148 | |
| 149 | def report_core(self, model, data_loader, device): |
| 150 | """Report core. |