def scale_for_robust_loss_function(J, f, rho):
 J_scale = (rho[1] + ((2 * rho[2]) * (f ** 2)))
 J_scale[(J_scale < EPS)] = EPS
 J_scale **= 0.5
 f *= (rho[1] / J_scale)
 return (left_multiply(J, J_scale, copy=False), f)

def scale_for_robust_loss_function ( J , f , rho ) : J_scale = ( rho [ 1 ] + ( ( 2 * rho [ 2 ] ) * ( f ** 2 ) ) ) J_scale [ ( J_scale < EPS ) ] = EPS J_scale **= 0.5 f *= ( rho [ 1 ] / J_scale ) return ( left_multiply ( J , J_scale , copy = False ) , f )
scale jacobian and residuals for a robust loss function .