Beispiel #1
0
    def __init__(self, resnet_size_choices=None):
        super(ResnetArgParser, self).__init__(parents=[
            parsers.BaseParser(),
            parsers.PerformanceParser(),
            parsers.ImageModelParser(),
            parsers.ExportParser(),
            parsers.BenchmarkParser(),
        ])

        self.add_argument(
            '--version',
            '-v',
            type=int,
            choices=[1, 2],
            default=resnet_model.DEFAULT_VERSION,
            help='Version of ResNet. (1 or 2) See README.md for details.')

        self.add_argument(
            '--resnet_size',
            '-rs',
            type=int,
            default=50,
            choices=resnet_size_choices,
            help='[default: %(default)s] The size of the ResNet model to use.',
            metavar='<RS>' if resnet_size_choices is None else None)
Beispiel #2
0
    def __init__(self):
        super(DANArgParser, self).__init__(parents=[
            parsers.BaseParser(),
            parsers.PerformanceParser(),
            parsers.ImageModelParser(),
        ])

        self.add_argument(
            "--data_dir_test",
            "-ddt",
            default=None,
            help="[default: %(default)s] The location of the test data.",
            metavar="<DD>",
        )

        self.add_argument(
            '--dan_stage',
            '-ds',
            type=int,
            default=1,
            choices=[1, 2],
            help='[default: %(default)s] The stage of the DAN model.')

        self.add_argument('--mode',
                          '-mode',
                          type=str,
                          default='train',
                          choices=['train', 'eval', 'predict'])

        self.add_argument('--num_lmark', '-nlm', type=int, default=68)
Beispiel #3
0
 def __init__(self):
     super(SimpNetArgParser, self).__init__(parents=[
         parsers.BaseParser(),
         parsers.PerformanceParser(),
         parsers.ImageModelParser(),
         parsers.BenchmarkParser(),
     ])
 def __init__(self):
     super(TestParser, self).__init__(parents=[
         parsers.BaseParser(),
         parsers.PerformanceParser(num_parallel_calls=True, inter_op=True,
                                   intra_op=True, use_synthetic_data=True),
         parsers.ImageModelParser(data_format=True),
         parsers.BenchmarkParser(benchmark_log_dir=True)
     ])
Beispiel #5
0
    def __init__(self):
        super(MNISTArgParser, self).__init__(parents=[
            parsers.BaseParser(),
            parsers.ImageModelParser(),
        ])

        self.set_defaults(data_dir='/tmp/mnist_data',
                          model_dir='/tmp/mnist_model',
                          batch_size=100,
                          train_epochs=40)
Beispiel #6
0
    def __init__(self):
        super(MNISTArgParser, self).__init__(parents=[
            parsers.BaseParser(),
            parsers.ImageModelParser(),
            parsers.ExportParser(),
        ])

        self.set_defaults(
            data_dir='/home/jcf/models-master/official/mnist/mnist_data',
            model_dir='/tmp/mnist_model',
            batch_size=100,
            train_epochs=40)
Beispiel #7
0
  def __init__(self, resnet_size_choices=None):
    super(ResnetArgParser, self).__init__(parents=[
        parsers.BaseParser(),
        parsers.PerformanceParser(),
        parsers.ImageModelParser(),
    ])

    self.add_argument(
        '--resnet_size', '-rs', type=int, default=50,
        choices=resnet_size_choices,
        help='[default: %(default)s]The size of the ResNet model to use.',
        metavar='<RS>'
    )
  def __init__(self, resnet_size_choices=None):
    super(ResnetArgParser, self).__init__(parents=[
        parsers.BaseParser(),
        parsers.PerformanceParser(),
        parsers.ImageModelParser(),
        parsers.ExportParser(),
        parsers.BenchmarkParser(),
    ])

    self.add_argument('--dataset','-d',default="cifar10",
        help='Which dataset to use (currently cifar10/cifar100)'
    )

    self.add_argument(
        '--version', '-v', type=int, choices=[1, 2],
        default=rncm.RESNET_DEFAULT_VERSION,
        help='Version of ResNet. (1 or 2) See README.md for details.'
    )

    self.add_argument(
        '--resnet_size', '-rs', type=int, default=50,
        choices=resnet_size_choices,
        help='[default: %(default)s] The size of the ResNet model to use.',
        metavar='<RS>' if resnet_size_choices is None else None
    )

    self.add_argument(
        '--continu',type=int,default=0,
        help='Continue with an existing model, or start from scratch'
    )

    self.add_argument(
        '--scratch',type=int,default=0,
        help='Start from scratch even if model exist'
    )

    self.add_argument(
        '--ncmmethod', default=rncm.NCM_DEFAULT_METHOD,
        help='[default: %(default)s] Which NCM method to use',
    )

    self.add_argument(
        '--ncmparam', default=rncm.NCM_DEFAULT_PARAMETER, type=float,
        help='[default: %(default)s] additional NCM parameter to use',
    )

    self.add_argument(
        '--initial_learning_scale', '-l', default=0.1, type=float,
        help='Intial Learning Scale (default: %(default)s)',
    )
Beispiel #9
0
    def __init__(self):
        super(MNISTEagerArgParser, self).__init__(parents=[
            parsers.BaseParser(
                epochs_between_evals=False, multi_gpu=False, hooks=False),
            parsers.ImageModelParser()
        ])

        self.add_argument(
            '--log_interval',
            '-li',
            type=int,
            default=10,
            metavar='N',
            help=
            '[default: %(default)s] batches between logging training status')
        self.add_argument(
            '--output_dir',
            '-od',
            type=str,
            default=None,
            metavar='<OD>',
            help=
            '[default: %(default)s] Directory to write TensorBoard summaries')
        self.add_argument('--lr',
                          '-lr',
                          type=float,
                          default=0.01,
                          metavar='<LR>',
                          help='[default: %(default)s] learning rate')
        self.add_argument('--momentum',
                          '-m',
                          type=float,
                          default=0.5,
                          metavar='<M>',
                          help='[default: %(default)s] SGD momentum')
        self.add_argument('--no_gpu',
                          '-nogpu',
                          action='store_true',
                          default=False,
                          help='disables GPU usage even if a GPU is available')

        self.set_defaults(
            data_dir='/tmp/tensorflow/mnist/input_data',
            model_dir='/tmp/tensorflow/mnist/checkpoints/',
            batch_size=100,
            train_epochs=10,
        )
Beispiel #10
0
    def __init__(self):
        super(MNISTArgParser, self).__init__(
            parents=[parsers.BaseParser(),
                     parsers.ImageModelParser()])

        self.add_argument(
            '--export_dir',
            type=str,
            help=
            '[default: %(default)s] If set, a SavedModel serialization of the '
            'model will be exported to this directory at the end of training. '
            'See the README for more details and relevant links.')

        self.set_defaults(data_dir='/tmp/mnist_data',
                          model_dir='/tmp/mnist_model',
                          batch_size=100,
                          train_epochs=40)
Beispiel #11
0
    def __init__(self, resnet_size_choices=None):
        super(ResnetArgParser, self).__init__(parents=[
            parsers.BaseParser(),
            parsers.PerformanceParser(),
            parsers.ImageModelParser(),
            parsers.ExportParser(),
            parsers.BenchmarkParser(),
        ])

        self.add_argument(
            '--version',
            '-v',
            type=int,
            choices=[1, 2],
            default=resnet_model.DEFAULT_VERSION,
            help='Version of ResNet. (1 or 2) See README.md for details.')

        self.add_argument(
            '--resnet_size',
            '-rs',
            type=int,
            default=50,
            choices=resnet_size_choices,
            help='[default: %(default)s] The size of the ResNet model to use.',
            metavar='<RS>' if resnet_size_choices is None else None)

        self.add_argument(
            '--enable_ml_comm',
            '-mc',
            type=int,
            choices=[0, 1],
            default=1,
            help=
            '[default: %(default)s] Whether to use Cray ML-Comm Distributed Training Plugin'
        )

        self.add_argument(
            '--global_perf_log_freq',
            '-pf',
            type=int,
            default=50,
            help=
            '[default: %(default)s] Number of steps after which to report global (all process averages) training loss and performance'
        )

        self.add_argument(
            '--warmup_epochs',
            '-we',
            type=int,
            default=0,
            help=
            '[default: %(default)s] Number of warmup epochs when using LARS')

        self.add_argument(
            '--base_lr',
            '-blr',
            type=float,
            default=1.0,
            help=
            '[default: %(default)s] Learning rate to start after warmup epochs finish when using LARS'
        )

        self.add_argument(
            '--init_lr',
            '-ilr',
            type=float,
            default=0.1,
            help=
            '[default: %(default)s] Learning rate to start warmup with when using LARS'
        )

        self.add_argument(
            '--weight_decay',
            '-wd',
            type=float,
            default=1e-4,
            help='[default: %(default)s] Weight decay to use during training')