Skip to content

Commit a1db159

Browse files
committed
Update: clean import
1 parent 3a49dab commit a1db159

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

gpt_sovits/AR/modules/lr_schedulers.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import math
44

55
import torch
6-
from matplotlib import pyplot as plt
7-
from torch import nn
8-
from torch.optim import Adam
96

107

118
class WarmupCosineLRSchedule(torch.optim.lr_scheduler._LRScheduler):
@@ -64,20 +61,3 @@ def step(self):
6461
self.lr = lr
6562
self._current_step += 1
6663
return self.lr
67-
68-
69-
if __name__ == "__main__":
70-
m = nn.Linear(10, 10)
71-
opt = Adam(m.parameters(), lr=1e-4)
72-
s = WarmupCosineLRSchedule(
73-
opt, 1e-6, 2e-4, 1e-6, warmup_steps=2000, total_steps=20000, current_step=0
74-
)
75-
lrs = []
76-
for i in range(25000):
77-
s.step()
78-
lrs.append(s.lr)
79-
print(s.lr)
80-
81-
plt.plot(lrs)
82-
plt.plot(range(0, 25000), lrs)
83-
plt.show()

0 commit comments

Comments
 (0)