For the sake of organization, I outline an ML optimizer with the rest of my config constants at the top of my file:
optimizer = torch.optim.SGD()
To use the optimizer, I have to pass in the model parameters, generated later on in the code
optimizer = torch.optim.SGD(model.parameters, lr=LEARNING_RATE)
Is there any way for me to pass arguments into the variable optimizer?
edit: I think my question is unclear, here's a simpler example of what I was asking:
#take the square of some arbitrary number
fn = math.prod()
x = 5
#how to feed x into the variable fn?