Empirical risk minimization and uniform convergence for probabilistically observed and quantum measurement hypothesis classes