本文整理汇总了Java中org.ejml.simple.SimpleMatrix.mult方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleMatrix.mult方法的具体用法?Java SimpleMatrix.mult怎么用?Java SimpleMatrix.mult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ejml.simple.SimpleMatrix
的用法示例。
在下文中一共展示了SimpleMatrix.mult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateMatrices
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
String evaluateMatrices(AdvancedDisplay display) throws SyntaxException {
try {
SimpleMatrix matrix = null;
boolean add = false;
boolean multiply = false;
for(int i = 0; i < display.getChildCount(); i++) {
View child = display.getChildAt(i);
if(child instanceof MatrixView) {
if(!add && !multiply) {
matrix = ((MatrixView) child).getSimpleMatrix();
}
else if(add) {
add = false;
if(matrix == null) throw new SyntaxException();
matrix = matrix.plus(((MatrixView) child).getSimpleMatrix());
}
else if(multiply) {
multiply = false;
if(matrix == null) throw new SyntaxException();
matrix = matrix.mult(((MatrixView) child).getSimpleMatrix());
}
}
else if(child instanceof MatrixTransposeView) {
if(matrix == null) throw new SyntaxException();
matrix = matrix.transpose();
}
else if(child instanceof MatrixInverseView) {
if(matrix == null) throw new SyntaxException();
matrix = matrix.invert();
}
else {
String text = child.toString();
if(text.length() > 1) throw new SyntaxException();
else if(text.length() == 0) continue;
if(text.startsWith(String.valueOf(Logic.MUL))) multiply = true;
else if(text.startsWith(String.valueOf(Logic.PLUS))) add = true;
else throw new SyntaxException();
}
}
return logic.mBaseModule.updateTextToNewMode(MatrixView.matrixToString(matrix, logic), Mode.DECIMAL, logic.mBaseModule.getMode());
}
catch(Exception e) {
throw new SyntaxException();
}
}
示例2: outputZ
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
/**
*
* @param W W[neuronas x entrada]
* @param a a[entrada x 1]
* @param B B[neuronas x 1]
* @return
*/
@Override
public SimpleMatrix outputZ(SimpleMatrix W, SimpleMatrix a, SimpleMatrix B) {
//return W.mult(a).plus(B);
//return W.mult(a).plus(B);
SimpleMatrix aux = W.mult(a);
for (int i = 0; i < aux.numCols(); i++) {
aux.setColumn(i, 0, aux.extractVector(false, i).plus(B).getMatrix().getData());
}
return aux;
}
示例3: outputZ
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
@Override
public SimpleMatrix outputZ(SimpleMatrix W, SimpleMatrix a, SimpleMatrix B) {
// return W.mult(a).plus(B);
SimpleMatrix aux = W.mult(a);
for (int i = 0; i < aux.numCols(); i++) {
aux.setColumn(i, 0, aux.extractVector(false, i).plus(B).getMatrix().getData());
}
return aux;
}
示例4: outputZ
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
/**
*
* @param W W[neuronas x entrada]
* @param a a[entrada x 1]
* @param B B[neuronas x 1]
* @return
*/
@Override
public SimpleMatrix outputZ(SimpleMatrix W, SimpleMatrix a, SimpleMatrix B) {
//return W.mult(a).plus(B);
SimpleMatrix aux = W.mult(a);
for (int i = 0; i < aux.numCols(); i++) {
aux.setColumn(i, 0, aux.extractVector(false, i).plus(B).getMatrix().getData());
}
return aux;
}
示例5: outputZ
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
@Override
public SimpleMatrix outputZ(SimpleMatrix W, SimpleMatrix a, SimpleMatrix B) {
//in softmax B is not necesary
//return W.mult(a);//.plus(B);
//return W.mult(a).plus(B);
SimpleMatrix aux = W.mult(a);
// for (int i = 0; i < aux.numCols(); i++) {
// aux.setColumn(i, 0, aux.extractVector(false, i).plus(B).getMatrix().getData());
// }
return aux;
}
示例6: outputZ
import org.ejml.simple.SimpleMatrix; //导入方法依赖的package包/类
@Override
public SimpleMatrix outputZ(SimpleMatrix W, SimpleMatrix a, SimpleMatrix B) {
// return W.mult(a).plus(B);
//return W.mult(a).plus(B);
SimpleMatrix aux = W.mult(a);
for (int i = 0; i < aux.numCols(); i++) {
aux.setColumn(i, 0, aux.extractVector(false, i).plus(B).getMatrix().getData());
}
return aux;
}