Isn’t LFBGS in the family of quasi Newtonian? If that’s good for you, you can just set optimizer to optimize.lfbgs (where I wrote Adam). you can also check all the other possible optimizers in the torch.optim package.