# MobileNetV2_1.0 ImageNet classification.
runtime:
  distribution_strategy: 'mirrored'
  mixed_precision_dtype: 'float32'
  loss_scale: 'dynamic'
task:
  model:
    num_classes: 1001
    input_size: [224, 224, 3]
    backbone:
      type: 'mobilenet'
      mobilenet:
        model_id: 'MobileNetV2'
        filter_size_scale: 1.0
    dropout_rate: 0.1
  losses:
    l2_weight_decay: 0
    one_hot: true
    label_smoothing: 0.1
  train_data:
    input_path: 'imagenet-2012-tfrecord/train*'
    is_training: true
    global_batch_size: 1024
    dtype: 'float32'
  validation_data:
    input_path: 'imagenet-2012-tfrecord/valid*'
    is_training: false
    global_batch_size: 1024
    dtype: 'float32'
    drop_remainder: false
  pruning:
    pretrained_original_checkpoint: 'gs://**/mobilenetv2_gpu/22984194/ckpt-625500'
    pruning_schedule: 'PolynomialDecay'
    begin_step: 0
    end_step: 80000
    initial_sparsity: 0.2
    final_sparsity: 0.5
    frequency: 400
trainer:
  # Top1 accuracy 71.33% after 17hr for 8 GPUs with pruning.
  # Pretrained network without pruning has Top1 accuracy 72.77%
  train_steps: 125100  # 50 epoch
  validation_steps: 98
  validation_interval: 2502
  steps_per_loop: 2502
  summary_interval: 2502
  checkpoint_interval: 2502
  optimizer_config:
    learning_rate:
      type: 'exponential'
      exponential:
        initial_learning_rate: 0.04
        decay_steps: 5004
        decay_rate: 0.85
        staircase: true
    warmup:
      type: 'linear'
      linear:
        warmup_steps: 0
