當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。