本文整理汇总了Java中org.ejml.simple.SimpleMatrix.scale方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleMatrix.scale方法的具体用法?Java SimpleMatrix.scale怎么用?Java SimpleMatrix.scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ejml.simple.SimpleMatrix
的用法示例。
在下文中一共展示了SimpleMatrix.scale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actualizarParametrosMomentum
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
/**
* W(+1) = W - stepSize * [(Dw / m)+ W * reg] <br>
* B(+1) = B - stepSize * (Db / m) <br>
*
* @param m cantidad de datos
*/
protected void actualizarParametrosMomentum(double m) {
for (int i = 0; i < net.getLayers().size(); i++) {
Layer layer = net.getLayers().get(i);
SimpleMatrix W = layer.getW();
SimpleMatrix B = layer.getB();
SimpleMatrix reg = W.scale(regularization);
SimpleMatrix vW = deltasWprev.get(i).scale(momentum).minus(deltasW.get(i).divide(m).plus(reg).scale(learningRate));
W = W.plus(vW);
SimpleMatrix vB = deltasBprev.get(i).scale(momentum).minus(deltasB.get(i).divide(m).scale(learningRate));
B = B.plus(vB);
layer.setW(W);
layer.setB(B);
net.getLayers().set(i, layer);
deltasBprev.set(i, vB);
deltasWprev.set(i, vW);
}
}
示例2: actualizarParametros
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
/**
* W(+1) = W - stepSize * [(Dw / m)+ W * reg] <br>
* B(+1) = B - stepSize * (Db / m) <br>
*
* @param m cantidad de datos
*/
protected void actualizarParametros(double m) {
//double div = stepSize / m;
for (int i = 0; i < net.getLayers().size(); i++) {
Layer layer = net.getLayers().get(i);
SimpleMatrix W = layer.getW();
SimpleMatrix B = layer.getB();
SimpleMatrix reg = W.scale(regularization);
W = W.minus(deltasW.get(i).divide(m).plus(reg).scale(learningRate));
B = B.minus(deltasB.get(i).divide(m).scale(learningRate));
layer.setW(W);
layer.setB(B);
net.getLayers().set(i, layer);
}
}