05b2b1c02a8ce5f471877243ebebe5df876ccc37,models/unet/train_unet.py,,main,#Any#,194
Before Change
def main(args):
if args.mode == "train":
load_version = 0 if args.resume else None
logger = TestTubeLogger(save_dir=args.exp_dir, name=args.exp, version=load_version)
trainer = create_trainer(args, logger)
model = UnetMRIModel(args)
trainer.fit(model)
else: // args.mode == "test"
assert args.checkpoint is not None
model = UnetMRIModel.load_from_checkpoint(str(args.checkpoint))
model.hparams.sample_rate = 1.
After Change
trainer.test(model)
def main(args=None):
parser = Args()
parser.add_argument("--mode", choices=["train", "test", "challenge"], default="train")
parser.add_argument("--num-epochs", type=int, default=50, help="Number of training epochs")
parser.add_argument("--gpus", type=int, default=1)
parser.add_argument("--nodes", type=int, default=1)
parser.add_argument("--exp-dir", type=pathlib.Path, default="experiments",
help="Path where model and results should be saved")
parser.add_argument("--exp", type=str, help="Name of the experiment")
parser.add_argument("--checkpoint", type=pathlib.Path,
help="Path to pre-trained model. Use with --mode {test,challenge}")
parser = UnetMRIModel.add_model_specific_args(parser)
if args is not None:
parser.set_defaults(**args)
args, _ = parser.parse_known_args()
random.seed(args.seed)
np.random.seed(args.seed)
torch.manual_seed(args.seed)
run(args)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: facebookresearch/fastMRI
Commit Name: 05b2b1c02a8ce5f471877243ebebe5df876ccc37
Time: 2020-04-15
Author: tulliemurrell@gmail.com
File Name: models/unet/train_unet.py
Class Name:
Method Name: main
Project Name: dnouri/skorch
Commit Name: 98b18cadf44257fde77b36ada1729feaab3aed97
Time: 2017-07-25
Author: marian.tietz@ottogroup.com
File Name: examples/word_language_model/train.py
Class Name:
Method Name:
Project Name: Hironsan/anago
Commit Name: b1ec0299de53bdc03870c39b00a1c88ff35cf0ea
Time: 2018-06-01
Author: hiroki.nakayama.py@gmail.com
File Name: examples/ner_glove.py
Class Name:
Method Name: