Skip to content

Commit

Permalink
updated train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
IshanRattan committed Aug 7, 2024
1 parent ce921e8 commit a8bcd54
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dl/image/classification/cifar10/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@
# # model(x)
# # print(model)
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.SGD(model.parameters(), lr=config.learning_rate, momentum=config.momentum)
_lr_scheduler = lr_scheduler.StepLR(optimizer, step_size=config.scheduler_step_size, gamma=config.scheduler_gamma)
optimizer = torch.optim.SGD(model.parameters(),
lr=config.learning_rate,
momentum=config.momentum)
_lr_scheduler = lr_scheduler.StepLR(optimizer,
step_size=config.scheduler_step_size,
gamma=config.scheduler_gamma)
model, losses = train_model(model,
criterion,
optimizer,
Expand Down

0 comments on commit a8bcd54

Please sign in to comment.