# Training configuration for EfficientNet-b1 trained on ImageNet on TPUs.
# Takes ~3 minutes, 15 seconds per epoch for v3-32.
# Note: This configuration uses a scaled per-replica batch size based on the number of devices.
runtime:
  model_dir: null
  mode: 'train_and_eval'
  distribution_strategy: 'tpu'
train_dataset:
  name: 'imagenet2012'
  data_dir: null
  builder: 'records'
  split: 'train'
  num_classes: 1000
  num_examples: 1281167
  batch_size: 128
  use_per_replica_batch_size: True
  dtype: 'bfloat16'
  augmenter:
    name: 'autoaugment'
validation_dataset:
  name: 'imagenet2012'
  data_dir: null
  builder: 'records'
  split: 'validation'
  num_classes: 1000
  num_examples: 50000
  batch_size: 128
  use_per_replica_batch_size: True
  dtype: 'bfloat16'
model:
  model_params:
    model_name: 'efficientnet-b1'
    overrides:
      num_classes: 1000
      batch_norm: 'tpu'
      dtype: 'bfloat16'
  optimizer:
    name: 'rmsprop'
    momentum: 0.9
    decay: 0.9
    moving_average_decay: 0.0
    lookahead: false
  learning_rate:
    name: 'exponential'
  loss:
    label_smoothing: 0.1
train:
  resume_checkpoint: True
  epochs: 500
evaluation:
  epochs_between_evals: 1
