| 256 | return dictionary |
| 257 | |
| 258 | def pretty_print(self): |
| 259 | self.writer = registry.get("writer") |
| 260 | |
| 261 | self.writer.write("===== Training Parameters =====", "info") |
| 262 | self.writer.write( |
| 263 | json.dumps(self.config.training_parameters, indent=4, sort_keys=True), |
| 264 | "info", |
| 265 | ) |
| 266 | |
| 267 | self.writer.write("====== Task Attributes ======", "info") |
| 268 | tasks = self.config.tasks.split(",") |
| 269 | datasets = self.config.datasets.split(",") |
| 270 | |
| 271 | for task in tasks: |
| 272 | if task not in self.config.task_attributes: |
| 273 | raise ValueError( |
| 274 | "Task {} not present in task_attributes config".format(task) |
| 275 | ) |
| 276 | |
| 277 | task_config = self.config.task_attributes[task] |
| 278 | |
| 279 | for dataset in datasets: |
| 280 | if dataset in task_config.dataset_attributes: |
| 281 | self.writer.write( |
| 282 | "======== {}/{} =======".format(task, dataset), "info" |
| 283 | ) |
| 284 | dataset_config = task_config.dataset_attributes[dataset] |
| 285 | self.writer.write( |
| 286 | json.dumps(dataset_config, indent=4, sort_keys=True), "info" |
| 287 | ) |
| 288 | |
| 289 | self.writer.write("====== Optimizer Attributes ======", "info") |
| 290 | self.writer.write( |
| 291 | json.dumps(self.config.optimizer_attributes, indent=4, sort_keys=True), |
| 292 | "info", |
| 293 | ) |
| 294 | |
| 295 | if self.config.model not in self.config.model_attributes: |
| 296 | raise ValueError( |
| 297 | "{} not present in model attributes".format(self.config.model) |
| 298 | ) |
| 299 | |
| 300 | self.writer.write( |
| 301 | "====== Model ({}) Attributes ======".format(self.config.model), "info" |
| 302 | ) |
| 303 | self.writer.write( |
| 304 | json.dumps( |
| 305 | self.config.model_attributes[self.config.model], |
| 306 | indent=4, |
| 307 | sort_keys=True, |
| 308 | ), |
| 309 | "info", |
| 310 | ) |
| 311 | |
| 312 | def _get_default_config_path(self): |
| 313 | directory = os.path.dirname(os.path.abspath(__file__)) |