Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamma factor in ncrp prior? #11

Open
jenli414 opened this issue Feb 28, 2020 · 1 comment
Open

Gamma factor in ncrp prior? #11

jenli414 opened this issue Feb 28, 2020 · 1 comment

Comments

@jenli414
Copy link

Hello! I'm a novice to hLDA and this might be wrong, but I'm wondering if the last (gamma)/(gamma+num_customers) really should be added for the leaves in calculate_ncrp_prior()? If we are on the lowest level, no new nodes can be added below, right?

def calculate_ncrp_prior(self, node_weights, node, weight):
        ''' Calculates the prior on the path according to the nested CRP '''

        for child in node.children:
            child_weight = log( float(child.customers) / (node.customers + self.gamma) )
            self.calculate_ncrp_prior(node_weights, child, weight + child_weight)

        node_weights[node] = weight + log( self.gamma / (node.customers + self.gamma))
@gauravkoradiya
Copy link

I have same confusion. I think there is no need to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants