本文整理汇总了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 );
}
示例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;
}
示例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);
}