05b2b1c02a8ce5f471877243ebebe5df876ccc37,models/unet/train_unet.py,,main,#,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.
trainer = create_trainer(args, logger=False)
trainer.test(model)
if __name__ == "__main__":
parser = Args()
parser.add_argument("--mode", choices=["train", "test"], default="train")
parser.add_argument("--num-epochs", type=int, default=50, help="Number of training epochs")
After Change
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: 3
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: Microsoft/MMdnn
Commit Name: fdeeaff5e452e257bf3a3dd76e25c81304cc4c98
Time: 2020-03-15
Author: linmajia@users.noreply.github.com
File Name: mmdnn/conversion/examples/tensorflow/vis_meta.py
Class Name:
Method Name: _main
Project Name: yahoo/TensorFlowOnSpark
Commit Name: 981e4266d4ea816b08a762193bd52f40cd1a3242
Time: 2019-08-07
Author: leewyang@verizonmedia.com
File Name: examples/mnist/mnist_data_setup.py
Class Name:
Method Name: