Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluating checkpoints #290

Closed
anderleich opened this issue Dec 16, 2019 · 9 comments
Closed

Evaluating checkpoints #290

anderleich opened this issue Dec 16, 2019 · 9 comments

Comments

@anderleich
Copy link

Hi,
I'm training a model for new english corpora. My question is: during training how can I know which is the best checkpoint according to the evaluation set? I need to know the best model for decoding.

@bfs18
Copy link

bfs18 commented Dec 16, 2019

In my opnion, the validition loss is not a relaible indiactor for the training status since teacher forcing input is used. You can keep out some data, inference on the text and calculate the mel specturm distance between the inferenced mel specturm and ground truth. This indiactor is used in Pre-Alignment Guided Attention for Improving Training Efficiency and Model Stability in End-to-End Speech Synthesis and Location-Relative Attention Mechanisms For Robust Long-Form Speech

@anderleich
Copy link
Author

Thanks @bfs18! Do you know some implementation of it in Python?

@bfs18
Copy link

bfs18 commented Dec 17, 2019

You can use this python package https://github.com/MattShannon/mcd

from mcd import dtw, metrics
# ref_data and syn_data are a numpy arrays of shape [n_frames, n_mel]
def _calculate_mcd(ref_data, syn_data):
    try:
        dist, path = dtw.dtw(ref_data, syn_data, metrics.eucCepDist)
        # the denominator is smaller and the avg mcd is larger if repeating or skipping occurs.
        # d = ref_data.shape[0] - np.abs(ref_data.shape[0] - syn_data.shape[0])
        d = ref_data.shape[0]
        return dist / d
    except IndexError:
        return -1.0```

@anderleich
Copy link
Author

anderleich commented Dec 17, 2019

Thanks, and how do I get ref and syn mel spectrograms from an audio and text pair?

I think this should be included in the repository. I wonder how people gets the best checkpoint with the current code...

@Yeongtae
Copy link

Yeongtae commented Dec 17, 2019

Use my branch.
https://github.com/Yeongtae/tacotron2/tree/monitoring_metric
#284

@anderleich
Copy link
Author

I've already done the training phase. I wouldn't like to retrain it. Is there a way to just evaluate held out data?

@Yeongtae
Copy link

Yeongtae commented Dec 17, 2019

I've already done the training phase. I wouldn't like to retrain it. Is there a way to just evaluate held out data?

Skip the training phase, and evaluate your model on validation set or test set.

@anderleich
Copy link
Author

Sorry, but I don't know how

@rafaelvalle
Copy link
Contributor

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants