当前位置: 首页>>代码示例>>Java>>正文


Java AtomicDouble.doubleValue方法代码示例

本文整理汇总了Java中com.google.common.util.concurrent.AtomicDouble.doubleValue方法的典型用法代码示例。如果您正苦于以下问题:Java AtomicDouble.doubleValue方法的具体用法?Java AtomicDouble.doubleValue怎么用?Java AtomicDouble.doubleValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.util.concurrent.AtomicDouble的用法示例。


在下文中一共展示了AtomicDouble.doubleValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectionScore

import com.google.common.util.concurrent.AtomicDouble; //导入方法依赖的package包/类
public double getProjectionScore(TerminologyService referenceTerminology) {
	AtomicDouble sum = new AtomicDouble(0);
	AtomicDouble total = new AtomicDouble(0);
	List<Term> top100 = topN(100).collect(toList());
	for(Term docTerm :top100) {
		total.addAndGet(docTerm.getSpecificity());
		int baseRank = getBaseRankInRefTermino(referenceTerminology, docTerm);
		if(baseRank > 0 && baseRank < 500)
			sum.addAndGet(docTerm.getSpecificity());
	}
	return sum.doubleValue() / total.doubleValue();
}
 
开发者ID:termsuite,项目名称:termsuite-core,代码行数:13,代码来源:DocumentProjectionService.java

示例2: score

import com.google.common.util.concurrent.AtomicDouble; //导入方法依赖的package包/类
@Override
public double score() {
    // Get estimate of normalization term
    INDArray buff = Nd4j.create(numDimensions);
    AtomicDouble sum_Q = new AtomicDouble(0.0);
    for (int n = 0; n < N; n++)
        tree.computeNonEdgeForces(n, theta, buff, sum_Q);

    // Loop over all edges to compute t-SNE error
    double C = .0;
    INDArray linear = Y;
    for (int n = 0; n < N; n++) {
        int begin = rows.getInt(n);
        int end = rows.getInt(n + 1);
        int ind1 = n;
        for (int i = begin; i < end; i++) {
            int ind2 = cols.getInt(i);
            buff.assign(linear.slice(ind1));
            buff.subi(linear.slice(ind2));

            double Q = pow(buff, 2).sum(Integer.MAX_VALUE).getDouble(0);
            Q = (1.0 / (1.0 + Q)) / sum_Q.doubleValue();
            C += vals.getDouble(i) * FastMath.log(vals.getDouble(i) + Nd4j.EPS_THRESHOLD)
                            / (Q + Nd4j.EPS_THRESHOLD);
        }
    }

    return C;
}
 
开发者ID:deeplearning4j,项目名称:deeplearning4j,代码行数:30,代码来源:BarnesHutTsne.java

示例3: parseSentence

import com.google.common.util.concurrent.AtomicDouble; //导入方法依赖的package包/类
/**
 * Build a chart for the sentence using the specified supertagger beam. If the chart exceeds the maximum size, beta
 * is doubled and the parser will re-try. When the function returns, beta will contain the value of the beam used
 * for the returned chart.
 *
 */
CompressedChart parseSentence(final List<String> sentence, final AtomicDouble beta,
		final Collection<Category> rootCategories) {
	final CompressedChart compressed;

	final List<Collection<Category>> categories = new ArrayList<>();
	final List<List<ScoredCategory>> tagsForSentence = tagger.tag(InputWord.listOf(sentence));
	for (final List<ScoredCategory> tagsForWord : tagsForSentence) {
		final List<Category> tagsForWord2 = new ArrayList<>();

		final double threshold = beta.doubleValue() * Math.exp(tagsForWord.get(0).getScore());

		for (final ScoredCategory leaf : tagsForWord) {
			if (Math.exp(leaf.getScore()) < threshold) {
				break;
			}
			tagsForWord2.add(leaf.getCategory());
		}

		categories.add(tagsForWord2);
	}

	// Find set of all parses
	final ChartCell[][] chart = parser.parse(sentence, categories);

	if (chart == null) {
		if (beta.doubleValue() * 2 < 0.1 && backoff) {
			beta.set(beta.doubleValue() * 2);
			return parseSentence(sentence, beta, rootCategories);
		} else {
			return null;
		}
	}
	if (chart[0][chart.length - 1] == null || chart[0][chart.length - 1].getEntries().size() == 0) {
		return null;
	}

	compressed = CompressedChart.make(InputWord.listOf(sentence), chart, cutoffsDictionary, unaryRules,
			rootCategories);

	return compressed;
}
 
开发者ID:uwnlp,项目名称:EasySRL,代码行数:48,代码来源:TrainingDataLoader.java

示例4: calculateCompressedEntries

import com.google.common.util.concurrent.AtomicDouble; //导入方法依赖的package包/类
private static double calculateCompressedEntries(Expression compressedTableExpression) {
	AtomicDouble count = new AtomicDouble(0);
	
	visitCompressedTableEntries(compressedTableExpression, count);
	
	return count.doubleValue();
}
 
开发者ID:aic-sri-international,项目名称:aic-praise,代码行数:8,代码来源:UAIMARSolver.java


注:本文中的com.google.common.util.concurrent.AtomicDouble.doubleValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。