The microscopic dynamics of many condensed matter systems occurring in nature and technology is dominated by rare but important barrier crossing events. Examples of such processes include nucleation at first order phase transitions, chemical reactions and the folding of biopolymers. The resulting wide ranges of time scales are a challenge for molecular simulation and numerous simulation methods have been developed to address this problem. Recently, machine learning methods have been proposed as a powerful way to further enhance such simulations. In my talk, I will discuss various machine learning approaches based on deep neural networks to sample rare reactive trajectories and identify the collective variable needed for the construction of low-dimensional models capturing the microscopic mechanism.