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

Change the Optimization Method (AdamW --> diffGrad)

Ouverte

#952 ouverte le 6 août 2023

 (1 commentaire) (0 réaction) (0 personne assignée)Python (2 849 forks)batch import
good first issue

Métriques du dépôt

Stars
 (18 427 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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

Guide contributeur