import torch


def adam(parameters, args):
    """Build adam."""
    return torch.optim.Adam(
        parameters,
        lr=args.lr,
        weight_decay=args.weight_decay,
        betas=(args.beta1, args.beta2),
    )