示例#1
0
  public void train(Point in, Point out, double learningRate) {
    Point mapped = map(in);

    List<Double> error = new ArrayList<Double>(mapped.size());
    for (int j : series(out.size())) {
      double t = out.get(j), o = mapped.get(j);

      error.add(o - t);
    }

    train(error, learningRate);
  }
示例#2
0
  public static ThreeLayer random(int n, int h, double var, Activation activation) {
    Builder<ThreeLayer> builder = builder(n, h, activation);
    List<Double> parameters = Point.random(builder.numParameters(), var);

    return builder.build(parameters);
  }