#NEWLINE# def _estimate_log_prob_resp( self , X ) : #NEWLINE# #INDENT# 'Estimate log probabilities and responsibilities for each sample.\n\n        Compute the log probabilities, weighted log probabilities per\n        component and responsibilities for each sample in X with respect to\n        the current state of the model.\n\n        Parameters\n        ----------\n        X : array-like, shape (n_samples, n_features)\n\n        Returns\n        -------\n        log_prob_norm : array, shape (n_samples,)\n            log p(X)\n\n        log_prob : array, shape (n_samples, n_components)\n            log p(X|Z) + log weights\n\n        log_responsibilities : array, shape (n_samples, n_components)\n            logarithm of the responsibilities\n        ' #NEWLINE# weighted_log_prob = self . _estimate_weighted_log_prob ( X ) #NEWLINE# log_prob_norm = logsumexp ( log_prob_norm , axis = 1 ) #NEWLINE# with np . errstate ( under = 'ignore' ) : #NEWLINE# #INDENT# log_resp = ( weighted_log_prob - log_prob_norm [ : , np . newaxis ] ) #NEWLINE# #UNINDENT# return ( log_prob_norm , weighted_log_prob , log_resp )