Examples of subtract()


Examples of de.jungblut.math.dense.DenseDoubleMatrix.subtract()

  public CostGradientTuple evaluateCost(DoubleVector theta) {

    DoubleVector activation = SIGMOID.get().apply(x.multiplyVectorRow(theta));
    DenseDoubleMatrix hypo = new DenseDoubleMatrix(Arrays.asList(activation));
    double error = ERROR_FUNCTION.calculateError(y, hypo);
    DoubleMatrix loss = hypo.subtract(y);
    double j = error / m;
    DoubleVector gradient = xTransposed.multiplyVectorRow(loss.getRowVector(0))
        .divide(m);
    if (lambda != 0d) {
      DoubleVector reg = theta.multiply(lambda / m);
View Full Code Here

Examples of de.jungblut.math.dense.DenseDoubleVector.subtract()

    DenseDoubleMatrix mat2 = new DenseDoubleMatrix(new double[][] {
        { 7, 8, 9 }, { 10, 11, 12 } });

    DoubleVector foldMatrices = DenseMatrixFolder.foldMatrices(mat1, mat2);
    assertEquals(12, foldMatrices.getLength());
    assertEquals(0.0d, referenceFold.subtract(foldMatrices).sum(), 1e-5);

    DoubleMatrix[] unfoldMatrices = DenseMatrixFolder.unfoldMatrices(
        foldMatrices, new int[][] { { 2, 3 }, { 2, 3 } });

    assertEquals(0.0d, unfoldMatrices[0].subtract(mat1).sum(), 1e-5);
View Full Code Here

Examples of de.jungblut.math.sparse.SparseDoubleRowMatrix.subtract()

    ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    DataInputStream in = new DataInputStream(bais);
    DoubleMatrix readMat = MatrixWritable.readSparseMatrix(in);

    assertEquals(0.0d, mat.subtract(readMat).sum(), 1e-4);

  }

}
View Full Code Here

Examples of de.tuhrig.thofu.types.LObject.subtract()

            n = token.run(environment, token);
          }
          else {

            n = n.subtract(token.run(environment, token));
          }
        }

        return n;
      }
View Full Code Here

Examples of er.chronic.utils.Span.subtract()

  public void testSpanMath() {
    Span span = new Span(1, 2);
    assertEquals(2, span.add(1).getBegin());
    assertEquals(3, span.add(1).getEnd());
    assertEquals(0, span.subtract(1).getBegin());
    assertEquals(1, span.subtract(1).getEnd());
  }
}
View Full Code Here

Examples of erjang.ENumber.subtract()

  @BIF(name = "-", type = Type.GUARD)
  static public ENumber minus$g(EObject v1, ESmall i2) {
    ENumber n1;
    if ((n1 = v1.testNumber()) != null) {
      return n1.subtract(i2.value);
    }
    return null;
  }

  @BIF(name = "*", type=Type.GUARD)
View Full Code Here

Examples of fork.lib.bio.anno.genomic.LandscapeTransformer.subtract()

    File f= new File("r2.wig");
   
    LandscapeBuilder lb= new BedGraphReader(f).getLandscapeBuilder();
   
    LandscapeTransformer lt= new LandscapeTransformer(lb);
    lt.subtract(10);
   
   
    PeakIdentifier pi= new PeakIdentifier(lb, null);
    pi.getPeaks().writeToFileBed(new File("peak_"+FileName.getBaseName(f)+".bed"));
   
View Full Code Here

Examples of gr.ntua.irmos.stubs.MapService_instance.MapPortType.subtract()

      // Access value
      System.out.println("Current value: "
          + map.getValueRP(new GetValueRP()));

      // Perform a subtraction
      map.subtract(5);

      // Access value
      System.out.println("Current value: "
          + map.getValueRP(new GetValueRP()));
     
View Full Code Here

Examples of java.awt.geom.Area.subtract()

          // Remove other rooms surface that may overlap the current room
          for (int i = homeRooms.size() - 1; i > 0 && homeRooms.get(i) != room; i--) {
            Room otherRoom = homeRooms.get(i);
            if (roomPart == FLOOR_PART && otherRoom.isFloorVisible()
                || roomPart == CEILING_PART && otherRoom.isCeilingVisible()) {
              roomArea.subtract(new Area(getShape(otherRoom.getPoints())));
            }
          }
        }
        // Retrieve the points of the different polygons
        // and reverse their points order if necessary
View Full Code Here

Examples of java.math.BigDecimal.subtract()

          computedResult = new BigDecimal(n.toString());
        }
        else
        {
          //noinspection ObjectToString
          computedResult = computedResult.subtract(new BigDecimal(n.toString()));
        }
      }
    }

    if (computedResult != null)
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.