def energy_functional(self, H_hat, S_hat, var_s0_hat, var_s1_hat, stats):

        entropy_term = self.entropy_hs(H_hat = H_hat, var_s0_hat = var_s0_hat, var_s1_hat = var_s1_hat).mean()
        likelihood_term = self.expected_log_prob_vhs(stats, H_hat = H_hat, S_hat = S_hat)

        energy_functional = likelihood_term + entropy_term
        assert len(energy_functional.type.broadcastable) == 0

        return energy_functional
.. todo::
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/s3c.py/S3C.energy_functional