Added flag to let update_hyperparameters return infinity upon hitting an exception.