(optim, params, lr=0.1, weight_decay=1e-4, momentum=0.9)
| 263 | |
| 264 | |
| 265 | def get_optim(optim, params, lr=0.1, weight_decay=1e-4, momentum=0.9): |
| 266 | if optim == 'sgd': |
| 267 | return torch.optim.SGD(params, lr=lr, weight_decay=weight_decay, momentum=momentum) |
| 268 | elif optim == 'adam': |
| 269 | return torch.optim.Adam(params, lr=lr, weight_decay=weight_decay) |
| 270 | |
| 271 | raise NotImplementedError('optimizer {} is not supported'.format(optim)) |
| 272 | |
| 273 | |
| 274 | def generic_init(args): |
nothing calls this directly
no outgoing calls
no test coverage detected