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