Ejemplo n.º 1
0
  private Mx leftContract(final Mx original) {
    final VecBasedMx contracted = new VecBasedMx(original.rows(), original.columns() - 1);

    for (int i = 0; i < contracted.rows(); i++) {
      for (int j = 0; j < contracted.columns(); j++) {
        contracted.set(i, j, original.get(i, j + 1));
      }
    }
    return contracted;
  }
Ejemplo n.º 2
0
  private Mx leftExtend(final Mx original) {
    final VecBasedMx extended = new VecBasedMx(original.rows(), original.columns() + 1);

    for (int i = 0; i < original.rows(); i++) {
      extended.set(i, 0, bias);
    }

    for (int i = 0; i < original.rows(); i++) {
      for (int j = 1; j < original.columns() + 1; j++) {
        extended.set(i, j, original.get(i, j - 1));
      }
    }
    return extended;
  }