Exemplo n.º 1
0
 def steplr_wrapper(optimizer):
     pytorch_support(required_version='1.0.0',
                     info_str='LRScheduler - StepLR')
     return optim.lr_scheduler.StepLR(optimizer,
                                      step_size=args.step_size,
                                      gamma=args.gamma,
                                      last_epoch=args.last_epoch)
Exemplo n.º 2
0
 def cosineannealinglr_wrapper(optimizer):
     pytorch_support(required_version='1.0.0',
                     info_str='LRScheduler - CosineAnnealingLR')
     return optim.lr_scheduler.CosineAnnealingLR(optimizer,
                                                 T_max=args.T_max,
                                                 eta_min=args.eta_min,
                                                 last_epoch=args.last_epoch)
Exemplo n.º 3
0
 def multisteplr_wrapper(optimizer):
     pytorch_support(required_version='1.0.0',
                     info_str='LRScheduler - MultiStepLR')
     return optim.lr_scheduler.MultiStepLR(optimizer,
                                           milestones=args.milestones,
                                           gamma=args.gamma,
                                           last_epoch=args.last_epoch)
Exemplo n.º 4
0
 def polynomiallr_wrapper(optimizer):
     pytorch_support(required_version='1.0.0',
                     info_str='LRScheduler - PolynomialLR')
     return PolynomialLR(optimizer,
                         epochs=args.epochs,
                         iters_per_epoch=args.iters_per_epoch,
                         power=args.power,
                         last_epoch=args.last_epoch)
Exemplo n.º 5
0
def run_script(config, proxy_file, proxy_class):
    # PixelSSL requires PyTorch >= 1.0.0
    pytorch_support(required_version='1.0.0', info_str='PixelSSL')

    # help information
    if len(sys.argv) > 1 and sys.argv[1] in ['help', '--help', 'h', '-h']:
        config['h'] = True

    # create parser and parse args from config
    parser = create_parser(config['ssl_algorithm'])
    proxy_file.add_parser_arguments(parser)
    args = cmd.parse_args(parser, config)

    task_proxy = proxy_class(args)
    task_proxy.run()
Exemplo n.º 6
0
 def exponentiallr_wrapper(optimizer):
     pytorch_support(required_version='1.0.0',
                     info_str='LRScheduler - ExponentialLR')
     return optim.lr_scheduler.ExponentialLR(optimizer,
                                             gamma=args.gamma,
                                             last_epoch=args.last_epoch)