Accessing objective function’s value from optimizer

p.data is x
 
p.grad.data is the gradient of f at x
 where <SCODE>for group in self.param_groups:
    for p in group['params']:
         pass
<ECODE> Is there any good way to get the value f(x) from optimizer? Thank you.
moskomule
apaszke
moskomule
apaszke
moskomule