logit_rules.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:mitre 作者: gerberlab 项目源码 文件源码
def flat_prior(self, state):
        """ Evaluate log-probability of each primitive in the population.

        Return value is properly normalized.

        This subclass ignores phylogenetic weights.

        """
        total_duration = float(self.data.experiment_end - self.data.experiment_start)
        durations = (self.rule_population.flat_durations /
                     ((1.0+self.window_duration_epsilon)*total_duration)
                    )
        window_a = (
            state.window_concentration *
            state.window_typical_fraction
        )
        window_b = (
            state.window_concentration *
            (1.0-state.window_typical_fraction)
        )
        window_weights = scipy.stats.beta.logpdf(
            durations, 
            window_a,
            window_b
        )

        weights = window_weights
        normalization = logsumexp(weights)
        return weights - normalization
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号