示例#1
0
文件: Layer.java 项目: HrundelB/jmll
  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;
  }
示例#2
0
文件: Layer.java 项目: HrundelB/jmll
  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;
  }