Skip to content

Commit 1a4aecf

Browse files
committed
change configuration
1 parent ded5bcf commit 1a4aecf

9 files changed

+21
-19
lines changed

.idea/workspace.xml

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,12 @@ I follow original paper's parameter settings. (below) <br>
352352
* n_heads = 8
353353
* ffn_hidden = 2048
354354
* drop_prob = 0.1
355-
* init_lr = 1e-6
355+
* init_lr = 1e-5
356356
* factor = 0.8
357357
* min_lr = init_lr * 1e-12
358358
* patience = 7
359359
* warmup = 100
360-
* weight_decay = 1e-4
360+
* weight_decay = 1e-3
361361
* epoch = 1000
362362
* clip = 1
363363

@@ -389,12 +389,12 @@ I follow original paper's parameter settings. (below) <br>
389389
* n_heads = 16
390390
* ffn_hidden = 4096
391391
* drop_prob = 0.3
392-
* init_lr = 1e-6
392+
* init_lr = 1e-5
393393
* factor = 0.8
394394
* min_lr = init_lr * 1e-12
395395
* patience = 7
396396
* warmup = 300
397-
* weight_decay = 1e-4
397+
* weight_decay = 1e-3
398398
* epoch = 3000
399399
* clip = 1
400400

__pycache__/conf.cpython-36.pyc

0 Bytes
Binary file not shown.

conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
drop_prob = 0.1
1919

2020
# optimizer parameter setting
21-
init_lr = 1e-6
21+
init_lr = 1e-5
2222
factor = 0.8
2323
min_lr = init_lr * 1e-12
2424
patience = 7
2525
warmup = 100
26-
weight_decay = 1e-4
26+
weight_decay = 1e-3
2727
epoch = 1000
2828
clip = 1
2929
inf = float('inf')

graph.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ def draw(mode):
2424
test = read('./result/test_loss.txt')
2525
plt.plot(train, 'r', label='train')
2626
plt.plot(test, 'b', label='validation')
27+
plt.legend(loc='lower left')
28+
2729

2830
elif mode == 'bleu':
2931
bleu = read('./result/bleu.txt')
3032
plt.plot(bleu, 'b', label='bleu score')
33+
plt.legend(loc='lower right')
3134

3235
plt.xlabel('epoch')
3336
plt.ylabel(mode)
3437
plt.title('training result')
3538
plt.grid(True, which='both', axis='both')
36-
plt.legend(loc='lower left')
3739
plt.show()
3840

3941

result/bleu.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[0.2501438161546564, 0.13948406463256255]
1+
[0.07622405577310074, 4.063269288356802]

result/test_loss.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[8.388485550880432, 7.465105414390564]
1+
[6.120936930179596, 5.668061196804047]

result/train_loss.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[9.24096984275112, 8.002939659068238]
1+
[7.244170436775106, 6.017328854699492]

retrain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def run(total_epoch, best_loss):
151151
f.write(str(test_losses))
152152
f.close()
153153

154-
print(f'Epoch: {step + 1} | Time: {epoch_mins}m {epoch_secs}s')
154+
print(f'Epoch: {step + 1 + train_count} | Time: {epoch_mins}m {epoch_secs}s')
155155
print(f'\tTrain Loss: {train_loss:.3f} | Train PPL: {math.exp(train_loss):7.3f}')
156156
print(f'\tVal Loss: {valid_loss:.3f} | Val PPL: {math.exp(valid_loss):7.3f}')
157157
print(f'\tBLEU Score: {bleu:.3f}')

0 commit comments

Comments
 (0)