本文整理汇总了C++中Shared::plus_group方法的典型用法代码示例。如果您正苦于以下问题:C++ Shared::plus_group方法的具体用法?C++ Shared::plus_group怎么用?C++ Shared::plus_group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shared
的用法示例。
在下文中一共展示了Shared::plus_group方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void init(
const Shared & shared,
const Group & group,
rng_t & rng) {
Shared post = shared.plus_group(group);
mean = sample_gamma(rng, post.alpha, 1.f / post.inv_beta);
}
示例2: init
void init(
const Shared & shared,
const Group & group,
rng_t & rng) {
Shared post = shared.plus_group(group);
beta = sample_beta(rng, post.alpha, post.beta);
}
示例3: score_data
float score_data(
const Shared & shared,
rng_t &) const {
Shared post = shared.plus_group(*this);
float score = fast_lgamma(shared.alpha + shared.beta)
- fast_lgamma(post.alpha + post.beta);
score += fast_lgamma(post.alpha) - fast_lgamma(shared.alpha);
score += fast_lgamma(post.beta) - fast_lgamma(shared.beta);
return score;
}
示例4: score_data
float score_data(
const Shared & shared,
rng_t &) const {
Shared post = shared.plus_group(*this);
float score = fast_lgamma(post.alpha) - fast_lgamma(shared.alpha);
score += shared.alpha * fast_log(shared.inv_beta)
- post.alpha * fast_log(post.inv_beta);
score += -log_prod;
return score;
}
示例5: score_value
float score_value(
const Shared & shared,
const Value & value,
rng_t &) const {
Shared post = shared.plus_group(*this);
float alpha = post.alpha + shared.r;
float beta = post.beta + value;
float score = fast_lgamma(post.alpha + post.beta)
- fast_lgamma(alpha + beta);
score += fast_lgamma(alpha) - fast_lgamma(post.alpha);
score += fast_lgamma(beta) - fast_lgamma(post.beta);
return score;
}