Spaces:
Build error
Build error
mrq commited on
Commit ·
c4ca04c
1
Parent(s): 8c647c8
added showing reported training accuracy and eval/validation metrics to graph
Browse files- src/utils.py +36 -6
src/utils.py
CHANGED
|
@@ -726,10 +726,6 @@ class TrainingState():
|
|
| 726 |
else:
|
| 727 |
return
|
| 728 |
|
| 729 |
-
if 'elapsed_time' in self.info:
|
| 730 |
-
self.info['iteration_rate'] = self.info['elapsed_time']
|
| 731 |
-
del self.info['elapsed_time']
|
| 732 |
-
|
| 733 |
self.info = data
|
| 734 |
if 'epoch' in self.info:
|
| 735 |
self.epoch = int(self.info['epoch'])
|
|
@@ -740,6 +736,9 @@ class TrainingState():
|
|
| 740 |
if 'steps' in self.info:
|
| 741 |
self.steps = int(self.info['steps'])
|
| 742 |
|
|
|
|
|
|
|
|
|
|
| 743 |
|
| 744 |
if 'iteration_rate' in self.info:
|
| 745 |
it_rate = self.info['iteration_rate']
|
|
@@ -772,12 +771,40 @@ class TrainingState():
|
|
| 772 |
|
| 773 |
if self.it > 0:
|
| 774 |
# probably can double for-loop but whatever
|
| 775 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 776 |
if k not in self.info:
|
| 777 |
continue
|
|
|
|
| 778 |
self.statistics['lr'].append({'epoch': epoch, 'it': self.it, 'value': self.info[k], 'type': k})
|
| 779 |
|
| 780 |
-
for k in ['
|
| 781 |
if k not in self.info:
|
| 782 |
continue
|
| 783 |
|
|
@@ -905,6 +932,9 @@ class TrainingState():
|
|
| 905 |
elif line.find('Validation Metrics:') >= 0:
|
| 906 |
data = json.loads(line.split("Validation Metrics:")[-1])
|
| 907 |
data['mode'] = "validation"
|
|
|
|
|
|
|
|
|
|
| 908 |
else:
|
| 909 |
continue
|
| 910 |
|
|
|
|
| 726 |
else:
|
| 727 |
return
|
| 728 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 729 |
self.info = data
|
| 730 |
if 'epoch' in self.info:
|
| 731 |
self.epoch = int(self.info['epoch'])
|
|
|
|
| 736 |
if 'steps' in self.info:
|
| 737 |
self.steps = int(self.info['steps'])
|
| 738 |
|
| 739 |
+
if 'elapsed_time' in self.info:
|
| 740 |
+
self.info['iteration_rate'] = self.info['elapsed_time']
|
| 741 |
+
del self.info['elapsed_time']
|
| 742 |
|
| 743 |
if 'iteration_rate' in self.info:
|
| 744 |
it_rate = self.info['iteration_rate']
|
|
|
|
| 771 |
|
| 772 |
if self.it > 0:
|
| 773 |
# probably can double for-loop but whatever
|
| 774 |
+
keys = {
|
| 775 |
+
'lrs': ['lr'],
|
| 776 |
+
'losses': ['loss_text_ce', 'loss_mel_ce'],
|
| 777 |
+
'accuracy': [],
|
| 778 |
+
}
|
| 779 |
+
if args.tts_backend == "vall-e":
|
| 780 |
+
keys['lrs'] = [
|
| 781 |
+
'ar.lr', 'nar.lr',
|
| 782 |
+
'ar-half.lr', 'nar-half.lr',
|
| 783 |
+
'ar-quarter.lr', 'nar-quarter.lr',
|
| 784 |
+
]
|
| 785 |
+
keys['losses'] = [
|
| 786 |
+
'ar.loss', 'nar.loss',
|
| 787 |
+
'ar-half.loss', 'nar-half.loss',
|
| 788 |
+
'ar-quarter.loss', 'nar-quarter.loss',
|
| 789 |
+
|
| 790 |
+
'ar.loss.nll', 'nar.loss.nll',
|
| 791 |
+
'ar-half.loss.nll', 'nar-half.loss.nll',
|
| 792 |
+
'ar-quarter.loss.nll', 'nar-quarter.loss.nll',
|
| 793 |
+
]
|
| 794 |
+
|
| 795 |
+
keys['accuracies'] = [
|
| 796 |
+
'ar.acc', 'nar.acc',
|
| 797 |
+
'ar-half.acc', 'nar-half.acc',
|
| 798 |
+
'ar-quarter.acc', 'nar-quarter.acc',
|
| 799 |
+
]
|
| 800 |
+
|
| 801 |
+
for k in keys['lrs']:
|
| 802 |
if k not in self.info:
|
| 803 |
continue
|
| 804 |
+
|
| 805 |
self.statistics['lr'].append({'epoch': epoch, 'it': self.it, 'value': self.info[k], 'type': k})
|
| 806 |
|
| 807 |
+
for k in keys['losses']:
|
| 808 |
if k not in self.info:
|
| 809 |
continue
|
| 810 |
|
|
|
|
| 932 |
elif line.find('Validation Metrics:') >= 0:
|
| 933 |
data = json.loads(line.split("Validation Metrics:")[-1])
|
| 934 |
data['mode'] = "validation"
|
| 935 |
+
if "it" not in data:
|
| 936 |
+
data['it'] = it
|
| 937 |
+
|
| 938 |
else:
|
| 939 |
continue
|
| 940 |
|