ngx-toastr
ngx-toastr copied to clipboard
Improve NAF calculation and fix info processing
Two changes with this PR:
-
Fixes an error in
Agent.fitthat prevented the use of numpy arrays as values in the info dictionary. Specifically,np.isrealreturns an array when called on an array, which cannot then be checked for truthity unlessnp.allis called on it. -
Improves the NAF calculation to reduce the amount of exponentiation necessary by multiplying by a diagonal mask both before and after exponentiation.
Now also fixes an error processing strange info dictionaries from gym environments.