You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The partial derivative of max currently uses the Julia Base implementation:
max(x,y) = ifelse(y < x, x, y)
Unfortunately, this may cause incorrect results when the Dual values agree but the partials do not:
max(Dual(3,1), Dual(3,-1))
Here, the values are both 3 but the partials have opposite signs. I think the partial here may be undefined.
Maybe something like:
function Base.max(a::Dual, b::Dual)
ifvalue(a) >value(b)
return a
elseifvalue(a) <value(b)
return b
else# value(a) == value(b)returnifelse(epsilon(a) ==epsilon(b), a, Dual(value(a), NaN))
endend
The text was updated successfully, but these errors were encountered:
The partial derivative of max currently uses the Julia Base implementation:
Unfortunately, this may cause incorrect results when the Dual values agree but the partials do not:
Here, the values are both 3 but the partials have opposite signs. I think the partial here may be undefined.
Maybe something like:
The text was updated successfully, but these errors were encountered: