tfp.glm.convergence_criteria_small_relative_norm_weights_change

View source on GitHub

Returns Python callable which indicates fitting procedure has converged.

Writing old, new model_coefficients as w0, w1, this function defines convergence as,

relative_euclidean_norm = (tf.norm(w0 - w1, ord=2, axis=-1) /
                           (1. + tf.norm(w0, ord=2, axis=-1)))
reduce_all(relative_euclidean_norm < tolerance)

where tf.norm(x, ord=2) denotes the Euclidean norm of x.

tolerance float-like Tensor indicating convergence, i.e., when max relative Euclidean norm weights difference < tolerance. Default value:1e-5. </td> </tr><tr> <td>norm_order</td> <td> Order of the norm. Default value:2` (i.e., "Euclidean norm".)

convergence_criteria_fn Python callable which returns bool Tensor indicated fitting procedure has converged. (See inner function specification for argument signature.) Default value: 1e-5.