"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "34a1b75f01667cc176304d7594245a7c308855df"
Commit 1b4ce76c authored by lukovnikov's avatar lukovnikov
Browse files

schedule fix

parent 5fed5bb3
......@@ -22,7 +22,7 @@ import torch
from pytorch_pretrained_bert import BertAdam
from pytorch_pretrained_bert.optimization import WarmupCosineWithWarmupRestartsSchedule
from matplotlib import pyplot as plt
#from matplotlib import pyplot as plt
import numpy as np
class OptimizationTest(unittest.TestCase):
......@@ -54,8 +54,8 @@ class WarmupCosineWithRestartsTest(unittest.TestCase):
m = WarmupCosineWithWarmupRestartsSchedule(warmup=0.05, t_total=1000, cycles=5)
x = np.arange(0, 1000)
y = [m.get_lr(xe) for xe in x]
plt.plot(y)
plt.show(block=False)
# plt.plot(y)
# plt.show(block=False)
y = np.asarray(y)
expected_zeros = y[[0, 200, 400, 600, 800]]
print(expected_zeros)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment