MCPcopy Index your code
hub / github.com/lisa-lab/DeepLearningTutorials / main

Function main

code/fcn_2D_segm/train_fcn8.py:373–417  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

371
372
373def main():
374 parser = argparse.ArgumentParser(description='FCN8 model training')
375 parser.add_argument('-dataset',
376 default='polyps',
377 help='Dataset.')
378 parser.add_argument('-learning_rate',
379 default=0.0001,
380 help='Learning Rate')
381 parser.add_argument('-penal_cst',
382 default=0.0,
383 help='regularization constant')
384 parser.add_argument('--num_epochs',
385 '-ne',
386 type=int,
387 default=750,
388 help='Optional. Int to indicate the max'
389 'number of epochs.')
390 parser.add_argument('-max_patience',
391 type=int,
392 default=100,
393 help='Max patience')
394 parser.add_argument('-batch_size',
395 type=int,
396 nargs='+',
397 default=[10, 1, 1],
398 help='Batch size [train, val, test]. Default: -batch_size 10 1 1')
399 parser.add_argument('-data_augmentation',
400 type=json.loads,
401 default={'crop_size': (224, 224), 'horizontal_flip': True, 'fill_mode':'constant'},
402 help='use data augmentation')
403 parser.add_argument('-early_stop_class',
404 type=int,
405 default=None,
406 help='class to early stop on')
407 parser.add_argument('-train_from_0_255',
408 type=bool,
409 default=False,
410 help='Whether to train from images within 0-255 range')
411 args = parser.parse_args()
412
413 train(args.dataset, float(args.learning_rate),
414 float(args.penal_cst), int(args.num_epochs), int(args.max_patience),
415 data_augmentation=args.data_augmentation, batch_size=args.batch_size,
416 early_stop_class=args.early_stop_class, savepath=SAVEPATH,
417 train_from_0_255=args.train_from_0_255)#, loadpath=LOADPATH)
418
419if __name__ == "__main__":
420 main()

Callers 1

train_fcn8.pyFile · 0.70

Calls 1

trainFunction · 0.70

Tested by

no test coverage detected