Generalized Energy Based Models