import torch


def optim_from_config(config, model):
  """Create an optimizer from a config."""
  return torch.optim.Adam(
      model.parameters(),
      lr=config.OPTIM.LR,
      weight_decay=config.OPTIM.WEIGHT_DECAY,
  )