Is it okay to feed optimizer to configure_optimizers
#11783
-
Hi all, is it okay to feed the optimizer that's been initialized outside this code to
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
yes, I think you can, but not a good practice, we recommend. just curious, why are you feeding it like that? |
Beta Was this translation helpful? Give feedback.
-
@rohitgr7
class LitModel(LightningModule):
def __init__():
def training_step():
loss = loss_function(predict, answer)
loss += quantizer.model_size() # quantizer is needed here!
return loss
def configure_optimizers(): Do you have any thoughts on the code structure? Thank you and hope to get your feedback! |
Beta Was this translation helpful? Give feedback.
yes, I think you can, but not a good practice, we recommend.
just curious, why are you feeding it like that?