Esempio n. 1
0
  /**
   * Called to update the stats, from the neural network.
   *
   * @param trial How many tries.
   * @param error The current error.
   */
  public void update(final int retry, final double error) {

    final UpdateStats stats = new UpdateStats();
    stats.tries = retry;
    stats.error = error;

    try {
      SwingUtilities.invokeAndWait(stats);
    } catch (final Exception e) {
      JOptionPane.showMessageDialog(this, "Error: " + e, "Training", JOptionPane.ERROR_MESSAGE);
    }
  }
Esempio n. 2
0
  /**
   * Called to update the stats, from the neural network.
   *
   * @param trial How many tries.
   * @param error The current error.
   * @param best The best error.
   */
  public void update(final int retry, final double totalError, final double bestError) {

    if (this.halt) {
      this.trainThread = null;
      this.train.setText("Begin Training");
      JOptionPane.showMessageDialog(
          this, "Training has completed.", "Training", JOptionPane.PLAIN_MESSAGE);
    }
    final UpdateStats stats = new UpdateStats();
    stats._tries = retry;
    stats._lastError = totalError;
    stats._bestError = bestError;
    try {
      SwingUtilities.invokeAndWait(stats);
    } catch (final Exception e) {
      JOptionPane.showMessageDialog(this, "Error: " + e, "Training", JOptionPane.ERROR_MESSAGE);
    }
  }