Alternative energy functions for optimizing neural networks