On the training and generalization of deep operator networks