Skip to content

Commit

Permalink
configuration change
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunwoongko committed Dec 18, 2019
1 parent c1c22a3 commit aecd5e9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
13 changes: 8 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified __pycache__/conf.cpython-36.pyc
Binary file not shown.
6 changes: 3 additions & 3 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
# optimizer parameter setting
init_lr = 1e-4
factor = 0.8
patience = 5
warmup = 3
weight_decay = 5e-3
patience = 10
warmup = 5
weight_decay = 5e-4
epoch = 2000
clip = 1
inf = float('inf')
2 changes: 1 addition & 1 deletion result/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[5.091137647628784, 5.0348674058914185, 5.0215981006622314, 5.0442681312561035, 5.031394064426422, 4.974141061306, 4.9869683384895325, 5.003897190093994, 5.022670149803162, 5.014573931694031, 5.0173457860946655, 5.000527858734131]
[4.984338045120239, 4.875711560249329, 4.780858218669891, 4.849339187145233, 4.910612761974335, 4.755706012248993, 4.562326073646545, 4.756882011890411,
2 changes: 1 addition & 1 deletion result/train.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[5.800987136521528, 5.191104743974324, 5.152123199160403, 5.133547501416984, 5.136521278498981, 5.121117488928303, 5.096929487152772, 5.088037919367988, 5.087618151425265, 5.086602942008804, 5.09127295279818, 5.10448893786527]
[5.617368328413774, 5.063993916112421, 4.893223413811906, 4.7998555536312155, 4.7442694508556755, 4.707525814157226, 4.618371282905209, 4.527510960196609,
7 changes: 4 additions & 3 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from torch.optim import Adam

from data import *
from graph import draw
from models.model.transformer import Transformer
from util.epoch_timer import epoch_time

Expand Down Expand Up @@ -39,9 +38,11 @@ def initialize_weights(m):

print(f'The model has {count_parameters(model):,} trainable parameters')
model.apply(initialize_weights)
optimizer = Adam(model.parameters(), lr=init_lr, weight_decay=weight_decay)
optimizer = Adam(params=model.parameters(),
lr=init_lr,
weight_decay=weight_decay)

scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimizer,
scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimizer=optimizer,
verbose=True,
factor=factor,
patience=patience)
Expand Down

0 comments on commit aecd5e9

Please sign in to comment.