Package aima.core.util.math

Examples of aima.core.util.math.Matrix.copy()


    Matrix activationTranspose = previousLayerActivationOrInput.transpose();
    Matrix momentumLessUpdate = layerSensitivity.getSensitivityMatrix()
        .times(activationTranspose).times(alpha).times(-1.0);
    Matrix updateWithMomentum = layer.getLastWeightUpdateMatrix()
        .times(momentum).plus(momentumLessUpdate.times(1.0 - momentum));
    layer.acceptNewWeightUpdate(updateWithMomentum.copy());
    return updateWithMomentum;
  }

  public static Matrix calculateWeightUpdates(
      LayerSensitivity layerSensitivity,
View Full Code Here


      Vector previousLayerActivationOrInput, double alpha) {
    Layer layer = layerSensitivity.getLayer();
    Matrix activationTranspose = previousLayerActivationOrInput.transpose();
    Matrix weightUpdateMatrix = layerSensitivity.getSensitivityMatrix()
        .times(activationTranspose).times(alpha).times(-1.0);
    layer.acceptNewWeightUpdate(weightUpdateMatrix.copy());
    return weightUpdateMatrix;
  }

  public Vector calculateBiasUpdates(LayerSensitivity layerSensitivity,
      double alpha, double momentum) {
View Full Code Here

  public Matrix sensitivityMatrixFromErrorMatrix(Vector errorVector) {
    Matrix derivativeMatrix = createDerivativeMatrix(layer
        .getLastInducedField());
    Matrix calculatedSensitivityMatrix = derivativeMatrix
        .times(errorVector).times(-2.0);
    sensitivityMatrix = calculatedSensitivityMatrix.copy();
    return calculatedSensitivityMatrix;
  }

  public Matrix sensitivityMatrixFromSucceedingLayer(
      LayerSensitivity nextLayerSensitivity) {
View Full Code Here

        .getLastInducedField());
    Matrix weightTranspose = nextLayer.getWeightMatrix().transpose();
    Matrix calculatedSensitivityMatrix = derivativeMatrix.times(
        weightTranspose).times(
        nextLayerSensitivity.getSensitivityMatrix());
    sensitivityMatrix = calculatedSensitivityMatrix.copy();
    return sensitivityMatrix;
  }

  public Layer getLayer() {
    return layer;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.