from typing import Dict


def parse_optimizer(opt_config: Dict) -> Dict:
    """
    Parse the optimizer configuration.

    :param opt_config: potentially outdated config
    :return: latest config
    """
    name = opt_config["name"]
    if name not in opt_config:
        # up-to-date
        return opt_config

    name_dict = dict(
        adam="Adam",
        sgd="SGD",
        rms="RMSprop",
    )
    new_name = name_dict[name]
    return {"name": new_name, **opt_config[name]}