An artificial neural network for controlling a technical system, the artificial neural network being trained using training data sets, including adaptation of a parameter of the artificial neural network depending on a loss function, the loss function including a first term that represents an estimate of a lower bound of distances between classifications of the training data sets by the artificial neural network and expected classifications of the training data sets, wherein the loss function includes a second term that is configured in such a way that differences in aleatoric uncertainty in the training data sets over different samples of the artificial neural network are regulated.