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


Java DoubleMatrix.addi方法代码示例

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


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

示例1: computeDerivatives

import org.jblas.DoubleMatrix; //导入方法依赖的package包/类
@Override
public void computeDerivatives(double t, double[] y, double[] yDot)
		throws MaxCountExceededException, DimensionMismatchException {
	int i,j;
	
	DoubleMatrix demeYdot;
	
	updateMatrices(t,y);
	demeYdot = births.columnSums().transpose();
	demeYdot.addi(migrations.columnSums().transpose());
	demeYdot.subi(migrations.rowSums());
	demeYdot.subi(deaths);
	
	for(i=0; i<numDemes; i++) { yDot[i] = demeYdot.get(i,0); }
	for(j=0; i<numDemes+numNonDemes; i++,j++) { yDot[i] = nondemeYdot[j]; }
	
	/* -- previous code optimisation
	if (this.fixedStepSize) {
		timeseries.addFG(t, births, migrations);
	}
	*/
	
}
 
开发者ID:mrc-ide,项目名称:PhyDyn,代码行数:24,代码来源:PopModelODE.java

示例2: calculateOutput

import org.jblas.DoubleMatrix; //导入方法依赖的package包/类
@Override
protected DoubleMatrix calculateOutput(DoubleMatrix inputVector,
		DoubleMatrix outputVector) {
	this.parameters.mmuli(inputVector, outputVector);
	outputVector.addi(this.bias, outputVector);
	return outputVector;
}
 
开发者ID:ramusa2,项目名称:CandCNFPerceptronParser,代码行数:8,代码来源:LinearLayer.java

示例3: getMeans

import org.jblas.DoubleMatrix; //导入方法依赖的package包/类
private DoubleMatrix getMeans(ArrayList<T> data) {
	DoubleMatrix means = new DoubleMatrix(this.dimension, 1);
	int N = data.size();
	for(T t : data) {
		DoubleMatrix vec = this.getOutput(t);
		means.addi(vec.divi(N), means);
	}
	return means;
}
 
开发者ID:ramusa2,项目名称:CandCNFPerceptronParser,代码行数:10,代码来源:InputLayer.java

示例4: processCoalEvent

import org.jblas.DoubleMatrix; //导入方法依赖的package包/类
protected double processCoalEvent(int t, int currTreeInterval) {
  	List<DoubleMatrix> coalVectors = stateProbabilities.getCoalescentVectors(intervals, currTreeInterval);
  	DoubleMatrix pvec1, pvec2;	
  	pvec1 = coalVectors.get(0);
  	pvec2 = coalVectors.get(1);
  	
  	
List<Node> parentLines = intervals.getLineagesAdded(currTreeInterval);
if (parentLines.size() > 1) throw new RuntimeException("Unsupported coalescent at non-binary node");			
//Add parent to activeLineage and initialise parent's state prob vector
Node parentNode = parentLines.get(0);


//Compute parent lineage state probabilities in p				
DoubleMatrix F,Y;
  	Y = ts.getYs()[t];
  	F = ts.getFs()[t];		
  	
  	 if (forgiveYInput.get()) {
		Y.maxi(1.0);
	} else { // however, Y_i > 1e-12 by default
		Y.maxi(1e-12); 
	}
 
  	 double lambda;
   /* Compute Lambda Sum */
DoubleMatrix pa;
   DoubleMatrix pi_Y = pvec1.div(Y);
   pi_Y.reshape(numStates, 1);	    	
   DoubleMatrix pj_Y = pvec2.div(Y);
   pj_Y.reshape(numStates, 1);	
   pa = pi_Y.mul(F.mmul(pj_Y));	    	
   pa.addi(pj_Y.mul(F.mmul(pi_Y)));
   pa.reshape(1,numStates);
   lambda = pa.sum();
   pa.divi(lambda);
			
stateProbabilities.addLineage(parentNode.getNr(),pa);
	
sp[parentNode.getNr() - nrSamples] = (pa);
 
//Remove child lineages
List<Node> coalLines = intervals.getLineagesRemoved(currTreeInterval);
stateProbabilities.removeLineageNr(coalLines.get(0).getNr() );
stateProbabilities.removeLineageNr(coalLines.get(1).getNr()); 
	
if (fsCorrectionsInput.get()) {
	doFiniteSizeCorrections(parentNode,pa);
}

return lambda;
  }
 
开发者ID:mrc-ide,项目名称:PhyDyn,代码行数:53,代码来源:STreeLikelihood.java


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