def optimize(gan, ddgan):
    """
    Create optimizer

    Args:
        gan (GAN): The GAN to optimize
        ddgan (Module): The ddgan module

    Returns:
        Optimizer: The optimizer
    """
    kwargs_opt = {
        "start_from": 0,
        "nPOD": 10,
        "nLatent": 100,
        "npredictions": 2,
        "optimizer_epochs": 10,
        "dt": 1,
        "gan": gan,
        "cycles": 2,
        "disturb": True,
        "gan": gan
    }

    optimizer = ddgan.Optimize(**kwargs_opt)

    return optimizer