本文整理匯總了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();
}
示例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;
}
示例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;
}
示例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();
}