<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def loglike(self, y, f):
 r""" Poisson log likelihood. Parameters y: ndarray array of integer targets f: ndarray latent function from the GLM prior (:math:`\mathbf{f} = \boldsymbol\Phi \mathbf{w}`) Returns ------- logp: ndarray the log likelihood of each y given each f under this likelihood. """

        y, f = np.broadcast_arrays(y, f)
        if self.tranfcn == 'exp':
            g = np.exp(f)
            logg = f
        else:
            g = softplus(f)
            logg = np.log(g)
        return y * logg - g - gammaln(y + 1)