Machine learning research is expanding its reach, beyond the traditional realm of the tech industry and into the activities of other scientists, opening the door to truly transformative advances in these disciplines. In this lecture I will focus on two aspects, modeling and experimental design, that are intertwined in the theory-experiment-analysis active learning loop that constitutes a core element of the scientific methodology. Computers will be necessary to go beyond the currently purely manual research loop and take advantage of high-throughput experimental setups and large-scale experimental datasets. I will discuss methods related to active learning, reinforcement learning, generative modeling, Bayesian ML, amortized variational learning and causal discovery. I will discuss the notion of epistemic uncertainty and how to estimate it. I will motivate generative policies that can sample a diverse set of candidate solutions to a problem, be it for proposing new experiments or causal hypotheses. Finally, I will describe current research to help us with these questions based on a new deep learning probabilistic framework called GFlowNets and how we plan to apply these in areas of great societal need like the unmet challenge of antimicrobial resistance or the discovery of new materials to help fight climate change.