Skip to content

Commit 2ff7a3b

Browse files
author
Yuhong Li
committed
Change the train epoch size
1 parent f396246 commit 2ff7a3b

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
class listDataset(Dataset):
1010
def __init__(self, root, shape=None, shuffle=True, transform=None, train=False, seen=0, batch_size=1, num_workers=4):
11+
if train:
12+
root = root *16
1113
random.shuffle(root)
1214

1315
self.nSamples = len(root)

make_model.ipynb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
{
44
"cell_type": "code",
55
"execution_count": 26,
6-
"metadata": {},
6+
"metadata": {
7+
"collapsed": true
8+
},
79
"outputs": [],
810
"source": [
911
"import torch.nn as nn\n",
@@ -83,6 +85,7 @@
8385
"cell_type": "code",
8486
"execution_count": 53,
8587
"metadata": {
88+
"collapsed": true,
8689
"scrolled": true
8790
},
8891
"outputs": [],
@@ -94,6 +97,7 @@
9497
"cell_type": "code",
9598
"execution_count": 54,
9699
"metadata": {
100+
"collapsed": true,
97101
"scrolled": true
98102
},
99103
"outputs": [],
@@ -122,15 +126,6 @@
122126
"source": [
123127
"model(x).shape"
124128
]
125-
},
126-
{
127-
"cell_type": "code",
128-
"execution_count": null,
129-
"metadata": {
130-
"collapsed": true
131-
},
132-
"outputs": [],
133-
"source": []
134129
}
135130
],
136131
"metadata": {

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def validate(val_list, model, criterion):
185185

186186
def adjust_learning_rate(optimizer, epoch):
187187
"""Sets the learning rate to the initial LR decayed by 10 every 30 epochs"""
188-
args.lr = args.lr * (0.1 ** (epoch // 30))
188+
args.lr = args.lr * (0.1 ** (epoch // 200))
189189
for param_group in optimizer.param_groups:
190190
param_group['lr'] = args.lr
191191

0 commit comments

Comments
 (0)