Skip to content

Gamma factor in ncrp prior? #11

@jenli414

Description

@jenli414

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions