  We analyze the stability of invariant tori for Hamiltonian systems with two
degrees of freedom by constructing a transformation that combines
Kolmogorov-Arnold-Moser theory and renormalization-group techniques. This
transformation is based on the continued fraction expansion of the frequency of
the torus. We apply this transformation numerically for arbitrary frequencies
that contain bounded entries in the continued fraction expansion. We give a
global picture of renormalization flow for the stability of invariant tori, and
we show that the properties of critical (and near critical) tori can be
obtained by analyzing renormalization dynamics around a single hyperbolic
strange attractor. We compute the fractal diagram, i.e., the critical coupling
as a function of the frequencies, associated with a given one-parameter family.
