Skip to content

Commit

Permalink
DenseNet161 with SGD
Browse files Browse the repository at this point in the history
  • Loading branch information
Junhong Xu committed Jun 15, 2017
1 parent c93568a commit 37f822a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion trainers/baseline_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def train_baselines():
logger = Logger('../log/{}'.format(name), name)

net = model()
optimizer = get_optimizer(net, lr=.01, pretrained=True, resnet=True if 'resnet' in name else False)
net = nn.DataParallel(net.cuda())

train_data.batch_size = batch
Expand All @@ -135,7 +136,7 @@ def train_baselines():
t = time.time()

for epoch in range(num_epoches): # loop over the dataset multiple times
optimizer = get_optimizer(net, lr=.01, pretrained=True, resnet=True if 'resnet' in name else False)

# train loss averaged every epoch
total_epoch_loss = 0.0

Expand Down
2 changes: 1 addition & 1 deletion util.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def evaluate(net, test_loader):
def get_learning_rate(optimizer):
lr=[]
for param_group in optimizer.param_groups:
lr +=[ param_group['lr'] ]
lr +=[param_group['lr']]
return lr


Expand Down

0 comments on commit 37f822a

Please sign in to comment.