public void run() {
    BAM logic = new BAM(INPUT_NEURONS, OUTPUT_NEURONS);

    // train
    for (int i = 0; i < NAMES.length; i++) {
      logic.addPattern(stringToBipolar(NAMES[i]), stringToBipolar(PHONES[i]));
    }

    // test
    for (int i = 0; i < NAMES.length; i++) {
      NeuralDataMapping data =
          new NeuralDataMapping(
              stringToBipolar(NAMES[i]), randomBiPolar(OUT_CHARS * BITS_PER_CHAR));
      runBAM(logic, data);
    }

    System.out.println();

    for (int i = 0; i < PHONES.length; i++) {
      NeuralDataMapping data =
          new NeuralDataMapping(
              stringToBipolar(PHONES[i]), randomBiPolar(IN_CHARS * BITS_PER_CHAR));
      runBAM(logic, data);
    }

    System.out.println();

    for (int i = 0; i < NAMES.length; i++) {
      NeuralDataMapping data =
          new NeuralDataMapping(
              stringToBipolar(NAMES2[i]), randomBiPolar(OUT_CHARS * BITS_PER_CHAR));
      runBAM(logic, data);
    }
  }
 public void runBAM(BAM logic, NeuralDataMapping data) {
   StringBuilder line = new StringBuilder();
   line.append(mappingToString(data));
   logic.compute(data);
   line.append("  |  ");
   line.append(mappingToString(data));
   System.out.println(line.toString());
 }