def loglikelihood(self, a, prob):
        '''
            Method computes loglikelihood of action (a) given probability (prob)
        '''
        if len(a.size()) == 3:
            a = a.view(-1, self.d)
            prob = prob.view(-1, 2 * self.d)

        mean0 = prob[:, :self.d]
        std0 = prob[:, self.d:]
        return - 0.5 * (((a - mean0) / std0).pow(2)).sum(dim=1, keepdim=True) - 0.5 * np.log(
            2.0 * np.pi) * self.d - std0.log().sum(dim=1, keepdim=True)

            Method computes loglikelihood of action (a) given probability (prob)
        
surreal/model/ppo_net.py