Skip to content

Update ImageNet training code #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 3, 2016
Merged

Conversation

colesbury
Copy link
Member

  • add learning rate schedule and weight decay
  • checkpointing
  • use pinned memory in data loader
  • don't use Trainer API for now

 - add learning rate schedule and weight decay
 - checkpointing
 - use pinned memory in data loader
 - don't use Trainer API for now
batch_size=args.batch_size, shuffle=False,
num_workers=args.workers, pin_memory=True)

# parallelize model across all visible GPUs

This comment was marked as off-topic.

model = torch.nn.DataParallel(model)

# define loss function (criterion) and pptimizer
criterion = nn.CrossEntropyLoss().cuda()

This comment was marked as off-topic.

def adjust_learning_rate(optimizer, epoch):
"""Sets the learning rate to the initial LR decayed by 10 every 30 epochs"""
lr = args.lr * (0.1 ** (epoch // 30))
for param_group in optimizer.state_dict()['param_groups']:

This comment was marked as off-topic.

@@ -114,7 +114,7 @@ def _make_layer(self, block, planes, blocks, stride=1):

layers = []
layers.append(block(self.inplanes, planes, stride, downsample))
self.inplanes = planes * block.expansion
self.inplanes = planes * block.expansion

This comment was marked as off-topic.

@soumith soumith merged commit 5a31116 into pytorch:master Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants