Examples of divide()


Examples of mikera.arrayz.INDArray.divide()

  }
 
  @Override
  public INDArray divideCopy(INDArray a) {
    INDArray r=this.broadcastCloneLike(a);
    r.divide(a);
    return r;
  }
 
  @Override
  public void addToArray(double[] data, int offset) {
View Full Code Here

Examples of mikera.vectorz.AVector.divide()

   
    for (int i=0; i<SIZE; i++) {
      AVector row=m.getRow(i);
      double sum=row.elementSum();
      if (sum>0) {
        row.divide(sum);
      } else {
        m.setRow(i, RepeatedElementVector.create(SIZE,1.0/SIZE));
      }
    }
   
View Full Code Here

Examples of net.sourceforge.processdash.util.DataPair.divide()

                appraisalCOQ.add(e.getValue());
            else if ("Failure".equals(phaseType))
                failureCOQ.add(e.getValue());
        }
        appraisalCOQ.divide(totalTime);
        failureCOQ.divide(totalTime);
        DataPair totalCOQ = new DataPair(appraisalCOQ).add(failureCOQ);
        DataPair afr = new DataPair(appraisalCOQ).divide(failureCOQ);
        printTableRow(res("%_Appraisal_COQ"), appraisalCOQ, Format.Percent);
        printTableRow(res("%_Failure_COQ"), failureCOQ, Format.Percent);
        printTableRow(res("%_Total_COQ"), totalCOQ, Format.Percent);
View Full Code Here

Examples of org.apache.commons.math3.analysis.differentiation.DerivativeStructure.divide()

    public DerivativeStructure getRadius(DerivativeStructure cx, DerivativeStructure cy) {
        DerivativeStructure r = cx.getField().getZero();
        for (Vector2D point : points) {
            r = r.add(distance(point, cx, cy));
        }
        return r.divide(points.size());
    }

    public double value(double[] variables)  {
        Vector2D center = new Vector2D(variables[0], variables[1]);
        double radius = getRadius(center);
View Full Code Here

Examples of org.apache.commons.math3.complex.Complex.divide()

        } else if (token.equals("-")) {
          stackAnswer.push(complexFormat.format(b.subtract(a)));
        } else if (token.equals("*")) {
          stackAnswer.push(complexFormat.format(b.multiply(a)));
        } else if (token.equals("/")) {
          stackAnswer.push(complexFormat.format(b.divide(a)));
        }
      } else if (isFunction(token)) {
        Complex a = complexFormat.parse(stackAnswer.pop());
        if (token.equals("abs")) {
          stackAnswer.push(complexFormat.format(a.abs()));
View Full Code Here

Examples of org.apache.examples.Calculator.divide()

        System.out.println("Inputs:   " + arg0 + " and " + arg1);
        System.out.println("Add:      " + calculator.add(arg0, arg1));
        System.out.println("Subtract: " + calculator.subtract(arg0, arg1));
        System.out.println("Multiply: " + calculator.multiply(arg0, arg1));
        System.out.println("Divide:   " + calculator.divide(arg0, arg1));


        registry.shutdown();
    }
}
View Full Code Here

Examples of org.apache.hama.commons.math.DoubleMatrix.divide()

      while ( (msg = peer.getCurrentMessage()) != null) {
        MatrixWritable tmp = (MatrixWritable) msg.get(msgFeatureMatrix);
        res.add(tmp.getMatrix());
        incomingMsgCount++;
      }
      res.divide(incomingMsgCount);
    }

    if (broadcast) {
      if (peer.getPeerName().equals(master)) {
        // broadcast to all
View Full Code Here

Examples of org.apache.mahout.math.DenseVector.divide()

          Vector v = SAMPLE_DATA.get(vix).get();
          count++;
          v.addTo(center);
          DisplayClustering.plotRectangle(g2, v, dv);
        }
        center = center.divide(count);
        DisplayClustering.plotEllipse(g2, center, dv1);
        DisplayClustering.plotEllipse(g2, center, dv2);
      }
    }
  }
View Full Code Here

Examples of org.apache.mahout.math.Matrix.divide()

            for (int l = 0; l < this.numberLayers; l++) {

                Matrix add = deltas.get( l ).getFirst().divide( this.inputTrainingData.numRows() ).times( lr );
                if(normalizeByInputRows)
                    add = add.divide( this.inputTrainingData.numRows() );

                if (useRegularization) {

                    //add = add.times( this.preTrainingLayers[ l ].getConnectionWeights().times( l2 ) );
                    add = MatrixUtils.elementWiseMultiplication(add, this.preTrainingLayers[ l ].getConnectionWeights().times( l2 ));
View Full Code Here

Examples of org.apache.mahout.math.Vector.divide()

      delta = x.minus(mean);
    } else {
      mean = x.like();
      delta = x.clone();
    }
    mean = mean.plus(delta.divide(n));
    if (m2 != null) {
      m2 = m2.plus(delta.times(x.minus(mean)));
    } else {
      m2 = delta.times(x.minus(mean));
    }
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.