Package org.encog.mathutil.matrices

Examples of org.encog.mathutil.matrices.Matrix


   *
   * @return U
   */

  public Matrix getU() {
    Matrix X = new Matrix(n, n);
    double[][] U = X.getData();
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i <= j) {
          U[i][j] = LU[i][j];
        } else {
View Full Code Here


      throw new RuntimeException("Matrix is singular.");
    }

    // Copy right hand side with pivoting
    int nx = B.getCols();
    Matrix Xmat = B.getMatrix(piv, 0, nx - 1);
    double[][] X = Xmat.getData();

    // Solve L*Y = B(piv,:)
    for (int k = 0; k < n; k++) {
      for (int i = k + 1; i < n; i++) {
        for (int j = 0; j < nx; j++) {
View Full Code Here

    int weightCount = theNetwork.getStructure().getFlat().getWeights().length;
    this.flat = theNetwork.getFlat();
    this.training = theTraining;
    this.network = theNetwork;
    this.gradients = new double[weightCount]
    this.hessianMatrix = new Matrix(weightCount,weightCount);
    this.hessian = this.hessianMatrix.getData();
  }
View Full Code Here

    int weightCount = theNetwork.getStructure().getFlat().getWeights().length;
   
    this.training = theTraining;
    this.network = theNetwork;
   
    this.hessianMatrix = new Matrix(weightCount,weightCount);
    this.hessian = this.hessianMatrix.getData();
   
    // create worker(s)
    final DetermineWorkload determine = new DetermineWorkload(
        this.numThreads, (int) this.training.getRecordCount());
View Full Code Here

   *
   * @return D
   */

  public Matrix getD() {
    final Matrix X = new Matrix(this.n, this.n);
    final double[][] D = X.getData();
    for (int i = 0; i < this.n; i++) {
      Arrays.fill(D[i], 0.0);
      D[i][i] = this.d[i];
      if (this.e[i] > 0) {
        D[i][i + 1] = this.e[i];
View Full Code Here

   * Return the eigenvector matrix.
   *
   * @return V
   */
  public Matrix getV() {
    return new Matrix(this.v);
  }
View Full Code Here

   */
  public ART1(final int theF1Count, final int theF2Count) {
    this.f1Count = theF1Count;
    this.f2Count = theF2Count;

    this.weightsF1toF2 = new Matrix(this.f1Count, this.f2Count);
    this.weightsF2toF1 = new Matrix(this.f2Count, this.f1Count);

    this.inhibitF2 = new boolean[this.f2Count];

    this.outputF1 = new BiPolarNeuralData(this.f1Count);
    this.outputF2 = new BiPolarNeuralData(this.f2Count);
View Full Code Here

      final int theOutstarCount, final int theWinnerCount) {
    this.inputCount = theInputCount;
    this.instarCount = theInstarCount;
    this.outstarCount = theOutstarCount;

    this.weightsInputToInstar = new Matrix(inputCount, instarCount);
    this.weightsInstarToOutstar = new Matrix(instarCount, outstarCount);
    this.winnerCount = theWinnerCount;
  }
View Full Code Here

          + " neurons, cannot learn a pattern of size "
          + pattern.size());
    }

    // Create a row matrix from the input, convert boolean to bipolar
    final Matrix m2 = Matrix.createRowMatrix(pattern.getData());
    // Transpose the matrix and multiply by the original input matrix
    final Matrix m1 = MatrixMath.transpose(m2);
    final Matrix m3 = MatrixMath.multiply(m1, m2);

    // matrix 3 should be square by now, so create an identity
    // matrix of the same size.
    final Matrix identity = MatrixMath.identity(m3.getRows());

    // subtract the identity matrix
    final Matrix m4 = MatrixMath.subtract(m3, identity);

    // now add the calculated matrix, for this pattern, to the
    // existing weight matrix.
    convertHopfieldMatrix(m4);
  }
View Full Code Here

   *            Number of input neurons
   * @param outputCount
   *            Number of output neurons
   */
  public SOM(final int inputCount, final int outputCount) {
    this.weights = new Matrix(outputCount, inputCount);
  }
View Full Code Here

TOP

Related Classes of org.encog.mathutil.matrices.Matrix

Copyright © 2018 www.massapicom. 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.