def infer_S_hat(self, V, H_hat, S_hat):

        for Vv, Hv in get_debug_values(V, H_hat):
            if Vv.shape != (self.model._test_batch_size,self.model.nvis):
                raise Exception('Well this is awkward. We require visible input test tags to be of shape '+str((self.model._test_batch_size,self.model.nvis))+' but the monitor gave us something of shape '+str(Vv.shape)+". The batch index part is probably only important if recycle_q is enabled. It's also probably not all that realistic to plan on telling the monitor what size of batch we need for test tags. the best thing to do is probably change self.model._test_batch_size to match what the monitor does")

            assert Vv.shape[0] == Hv.shape[0]
            if not (Hv.shape[1] == self.model.nhid):
                raise AssertionError("Hv.shape[1] is %d, does not match self.model.nhid, %d" \
                        % ( Hv.shape[1], self.model.nhid) )


        mu = self.model.mu
        alpha = self.model.alpha
        W = self.model.W
        B = self.model.B
        w = self.model.w

        BW = B.dimshuffle(0,'x') * W
        BW.name = 'infer_S_hat:BW'

        HS = H_hat * S_hat
        HS.name = 'infer_S_hat:HS'

        mean_term = mu * alpha
        mean_term.name = 'infer_S_hat:mean_term'

        assert V.dtype == config.floatX
        assert BW.dtype == config.floatX, \
            "Expected %s, got %s" % (config.floatX, BW.dtype)
        data_term = T.dot(V, BW)
        data_term.name = 'infer_S_hat:data_term'

        iterm_part_1 = - T.dot(T.dot(HS, W.T), BW)
        iterm_part_1.name = 'infer_S_hat:iterm_part_1'
        assert w.name is not None
        iterm_part_2 = w * HS
        iterm_part_2.name = 'infer_S_hat:iterm_part_2'

        interaction_term = iterm_part_1 + iterm_part_2
        interaction_term.name = 'infer_S_hat:interaction_term'

        for i1v, Vv in get_debug_values(iterm_part_1, V):
            assert i1v.shape[0] == Vv.shape[0]


        assert mean_term.dtype == config.floatX
        assert data_term.dtype == config.floatX
        assert interaction_term.dtype == config.floatX

        debug_interm = mean_term + data_term
        debug_interm.name = 'infer_S_hat:debug_interm'

        numer = debug_interm + interaction_term
        numer.name = 'infer_S_hat:numer'
        assert numer.dtype == config.floatX

        alpha = self.model.alpha
        w = self.model.w

        denom = alpha + w
        assert denom.dtype == config.floatX
        denom.name = 'infer_S_hat:denom'

        S_hat =  numer / denom


        return S_hat
Retrieves Cloud Storage project id from user or file.
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/s3c.py/E_Step.infer_S_hat--crossover with--dataset/ETHPy150Open googlearchive/storage-getting-started-python/main.py/get_project_id