So unlike the legacy modules, I don’t think I can make a feval function which I input into the optimizer. Instead I have to do it like this:
optimizer = optim.LBFGS([img], optim_state)

And then I input the feval function via optimizer.step inside of loop:
optimizer.step(feval)