Пример #1
0
    def entropy_h(self, H_hat):
        """
        .. todo::

            WRITEME properly

        entropy of the hidden layers under the mean field distribution
        defined by H_hat
        """

        for Hv in get_debug_values(H_hat[0]):
            assert Hv.min() >= 0.0
            assert Hv.max() <= 1.0

        total = entropy_binary_vector(H_hat[0])

        for H in H_hat[1:]:

            for Hv in get_debug_values(H):
                assert Hv.min() >= 0.0
                assert Hv.max() <= 1.0

            total += entropy_binary_vector(H)

        return total
Пример #2
0
    def entropy_h(self, H_hat):
        """ entropy of the hidden layers under the mean field distribution
        defined by H_hat """

        total = entropy_binary_vector(H_hat[0])

        for H in H_hat[1:]:
            total += entropy_binary_vector(H)

        return total