Package de.jungblut.math

Examples of de.jungblut.math.DoubleVector.multiply()


    DoubleVector df1 = evaluateCost.getGradient();
    i = i + (length < 0 ? 1 : 0);
    // search direction is steepest
    DoubleVector s = df1.multiply(-1.0d);

    double d1 = s.multiply(-1.0d).dot(s); // this is the slope
    double z1 = red / (1.0 - d1); // initial step is red/(|s|+1)

    while (i < Math.abs(length)) {// while not finished
      i = i + (length > 0 ? 1 : 0);// count iterations?!
      // make a copy of current values
View Full Code Here


        alpha = this.alpha / (1d + iteration / annealingIteration);
      }
      // save our last parameter
      lastTheta = theta;
      // basically subtract the gradient multiplied with the learning rate
      theta = theta.subtract(gradient.multiply(alpha));
      if (lastTheta != null && momentum != 0d) {
        // we add momentum as the parameter "m" multiplied by the difference of
        // both theta vectors
        theta = theta.add((lastTheta.subtract(theta)).multiply(momentum));
      }
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.