  We study the performance of a stochastic algorithm based on the power method
that adaptively learns the large deviation functions characterizing the
fluctuations of additive functionals of Markov processes, used in physics to
model nonequilibrium systems. This algorithm was introduced in the context of
risk-sensitive control of Markov chains and was recently adapted to diffusions
evolving continuously in time. Here we provide an in-depth study of the
convergence of this algorithm close to dynamical phase transitions, exploring
the speed of convergence as a function of the learning rate and the effect of
including transfer learning. We use as a test example the mean degree of a
random walk on an Erd\"os-R\'enyi random graph, which shows a transition
between high-degree trajectories of the random walk evolving in the bulk of the
graph and low-degree trajectories evolving in dangling edges of the graph. The
results show that the adaptive power method is efficient close to dynamical
phase transitions, while having many advantages in terms of performance and
complexity compared to other algorithms used to compute large deviation
functions.
