Search code examples
javaneural-networkwekaconvergence

cannot test the convergence of neural network


I'm using Weka multilayer-perceptron classifier to do classifications. I want to know after exactly how many epochs the neural network converges (weights don't update any more).

I'm using its Java API, but I cannot figure out a way to get the weight variables and test whether they're still changing or not in a loop.


Solution

  • From NeuralNode:

      /**
       * call this function to get the change in weights array.
       * This will also allow the change in weights to be updated.
       * @return The change in weights array.
       */
      public double[] getChangeInWeights() {
        return m_changeInWeights;
      }
    

    If you go to where your Weka folder is, you can extract the source code for Weka from weka-src.jar. This was in: /src/main/java/weka/classifiers/functions/neural/NeuralNode.java.