Dynamics of Mode-Switching in Neural Networks: How nonlinear systems generate behaviour via a thermodynamic process