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


Java Vector.dotTimes方法代码示例

本文整理汇总了Java中gov.sandia.cognition.math.matrix.Vector.dotTimes方法的典型用法代码示例。如果您正苦于以下问题:Java Vector.dotTimes方法的具体用法?Java Vector.dotTimes怎么用?Java Vector.dotTimes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.sandia.cognition.math.matrix.Vector的用法示例。


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

示例1: computeBackwardProbabilities

import gov.sandia.cognition.math.matrix.Vector; //导入方法依赖的package包/类
/**
 * Computes the backward probability recursion.
 * @param beta
 * Beta from the "next" time step.
 * @param b
 * Observation likelihood from the "next" time step.
 * @param weight
 * Weight to use for the current time step.
 * @return
 * Beta for the previous time step, weighted by "weight".
 */
protected WeightedValue<Vector> computeBackwardProbabilities(
    Vector beta,
    Vector b,
    double weight )
{
    Vector betaPrevious = b.dotTimes(beta);
    betaPrevious = betaPrevious.times( this.getTransitionProbability() );
    if( weight != 1.0 )
    {
        betaPrevious.scaleEquals(weight);
    }
    return new DefaultWeightedValue<Vector>( betaPrevious, weight );
}
 
开发者ID:algorithmfoundry,项目名称:Foundry,代码行数:25,代码来源:HiddenMarkovModel.java

示例2: computeStateObservationLikelihood

import gov.sandia.cognition.math.matrix.Vector; //导入方法依赖的package包/类
/**
 * Computes the probability of the various states at a time instance given
 * the observation sequence.  Rabiner calls this the "gamma".
 * @param alpha
 * Forward probability at time n.
 * @param beta
 * Backward probability at time n.
 * @param scaleFactor
 * Amount to scale the gamma by
 * @return
 * Gamma at time n.
 */
protected static Vector computeStateObservationLikelihood(
    Vector alpha,
    Vector beta,
    double scaleFactor )
{
    Vector gamma = alpha.dotTimes(beta);
    gamma.scaleEquals(scaleFactor/gamma.norm1());
    return gamma;
}
 
开发者ID:algorithmfoundry,项目名称:Foundry,代码行数:22,代码来源:HiddenMarkovModel.java

示例3: computeTransitions

import gov.sandia.cognition.math.matrix.Vector; //导入方法依赖的package包/类
/**
 * Computes the stochastic transition-probability matrix from the
 * given probabilities.
 * @param alphan
 * Result of the forward pass through the HMM at time n
 * @param betanp1
 * Result of the backward pass through the HMM at time n+1
 * @param bnp1
 * Conditionally independent likelihoods of each observation at time n+1
 * @return
 * Transition probabilities at time n
 */
protected static Matrix computeTransitions(
    Vector alphan,
    Vector betanp1,
    Vector bnp1 )
{
    Vector bnext = bnp1.dotTimes(betanp1);
    return bnext.outerProduct(alphan);
}
 
开发者ID:algorithmfoundry,项目名称:Foundry,代码行数:21,代码来源:HiddenMarkovModel.java


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