- add additional condition in svd helper to take into account rounding errors (#31)
Signed-off-by: Yurii <iuriish@yahoo.com>master
parent
9124974e3b
commit
871f3bb3e6
|
@ -469,7 +469,7 @@ void SVD<T>::calcSingVals(const NDArray& col0, const NDArray& diag, const NDArra
|
||||||
useBisection = true;
|
useBisection = true;
|
||||||
if (shift == right && (muCur < -(right - left) || muCur > (T)0.))
|
if (shift == right && (muCur < -(right - left) || muCur > (T)0.))
|
||||||
useBisection = true;
|
useBisection = true;
|
||||||
if (math::nd4j_abs<T>(fCur) > math::nd4j_abs<T>(fPrev))
|
if (math::nd4j_abs<T>(fCur) > math::nd4j_abs<T>(fPrev) && math::nd4j_abs<T>(fCur - fPrev) > (T)16. * DataTypeUtils::eps<T>())
|
||||||
useBisection = true;
|
useBisection = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -466,7 +466,7 @@ void SVD<T>::calcSingVals(const NDArray& col0, const NDArray& diag, const NDArra
|
||||||
useBisection = true;
|
useBisection = true;
|
||||||
if (shift == right && (muCur < -(right - left) || muCur > (T)0.))
|
if (shift == right && (muCur < -(right - left) || muCur > (T)0.))
|
||||||
useBisection = true;
|
useBisection = true;
|
||||||
if (math::nd4j_abs<T>(fCur) > math::nd4j_abs<T>(fPrev))
|
if (math::nd4j_abs<T>(fCur) > math::nd4j_abs<T>(fPrev) && math::nd4j_abs<T>(fCur - fPrev) > (T)16. * DataTypeUtils::eps<T>())
|
||||||
useBisection = true;
|
useBisection = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue