Yeah I did set this inside a nn.Module, but I also manually passed the weight variables to the optimiser
params = list(model.parameters()) + list(loss_function.w1) + list(loss_function.w2)
optimiser = optim.SGD(params)  

The manual passing is necessary since the weight(s) would not be added to model.parameters() even if I decleared it as nn.Parameter() within the nn.Module.