VfiTest / modules /optimizer.py
SuyeonJ's picture
Upload folder using huggingface_hub
8d015d4 verified
raw
history blame
240 Bytes
from torch.optim import *
def make_optimizer(params, optimizer_spec):
optimizer = {
'sgd': SGD,
'adam': Adam,
'adamW': AdamW
}[optimizer_spec['name']](params, **optimizer_spec['args'])
return optimizer