| 409 | print("Finished training.") |
| 410 | |
| 411 | def get_args_parser(): |
| 412 | |
| 413 | parser = argparse.ArgumentParser('Training script', add_help=False) |
| 414 | |
| 415 | parser.add_argument( |
| 416 | "--manifest", |
| 417 | type=str, |
| 418 | help="CSV file listing all slides, their labels, and which split (train/test/val) they belong to.", |
| 419 | ) |
| 420 | parser.add_argument( |
| 421 | "--n_bins", |
| 422 | type=int, |
| 423 | help="Number of time intervals used to create the time labels. It should be the same as the manifest.", |
| 424 | ) |
| 425 | parser.add_argument( |
| 426 | "--data_dir", |
| 427 | type=str, |
| 428 | help="Directory where all *_features.h5 files are stored", |
| 429 | ) |
| 430 | parser.add_argument( |
| 431 | "--input_feature_size", |
| 432 | help="The size of the input features from the feature bags. Recommend going by blocks from these output size [96, 96, 192, 192, 384, 384, 384, 384, 768, 768]", |
| 433 | type=int, |
| 434 | required=True, |
| 435 | ) |
| 436 | parser.add_argument( |
| 437 | "--checkpoint_model_molecular", |
| 438 | type=str, |
| 439 | default='', |
| 440 | help="Path to checkpoint of im4MEC", |
| 441 | ) |
| 442 | parser.add_argument( |
| 443 | "--n_classes_molecular", |
| 444 | type=int, |
| 445 | required=True, |
| 446 | help="", |
| 447 | ) |
| 448 | parser.add_argument( |
| 449 | "--feature_size_comp_molecular", |
| 450 | type=int, |
| 451 | required=True, |
| 452 | help="Size of the model of the trained im4MEC. See in im4MEC.py", |
| 453 | ) |
| 454 | parser.add_argument( |
| 455 | "--feature_size_attn_molecular", |
| 456 | type=int, |
| 457 | required=True, |
| 458 | help="Size of the model of the trained im4MEC. See in im4MEC.py", |
| 459 | ) |
| 460 | parser.add_argument( |
| 461 | "--workers", |
| 462 | help="The number of workers to use for the data loaders.", |
| 463 | type=int, |
| 464 | default=4, |
| 465 | ) |
| 466 | parser.add_argument( |
| 467 | "--hp", |
| 468 | type=int, |