RVC-Project/Retrieval-based-Voice-Conversion-WebUI

Change the Optimization Method (AdamW --> diffGrad)

Open

#952 创建于 2023年8月6日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Python (2,849 fork)batch import
good first issue

仓库指标

Star
 (18,427 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Adamw was replaced by a new optimization method - diffgrad. What do you think about it? Will you add it to increase the accuracy in the experiment?

Change

    optim_g = torch.optim.AdamW(
        net_g.parameters(),
        hps.train.learning_rate,
        betas=hps.train.betas,
        eps=hps.train.eps,
    )
    optim_d = torch.optim.AdamW(
        net_d.parameters(),
        hps.train.learning_rate,
        betas=hps.train.betas,
        eps=hps.train.eps,
    )

To

pip install torch-optimizer
...

import torch_optimizer as optimizer
...

    optim_g = optimizer.DiffGrad(
        net_g.parameters(),
        hps.train.learning_rate,
        betas=hps.train.betas,
        eps=hps.train.eps,
    )
    optim_d = optimizer.DiffGrad(
        net_d.parameters(),
        hps.train.learning_rate,
        betas=hps.train.betas,
        eps=hps.train.eps,
    )

Source diffGrad: https://github.com/shivram1987/diffGrad

贡献者指南