
=====================================================

              IMPORTANT API CHANGES

=====================================================

Important changes in the API of Neuroph 2.3.1

There are some changes in ImageRecognitionPlugin which will prevent exceptions when using this feature.
Now, color mode used in training is saved into neural network and it is not required to specify when using network in recognition mode. So recognizeImage(image, colorMode) and related methods are removed, and the colorMode is set automaticaly. Unfotunately this is not backward compatibile with previously trained neural networks so you may need to re-train them in order to use the 2.3.1 library.



Important changes in the API of Neuroph 2.3


1. Class NeuralNetwork
  
  learn(TrainingSet trainingSetToLearn) method has been deprecated, and instead that method you can use one of the following methods:
  
  learnInSameThread(TrainingSet trainingSetToLearn), trains the network with the specified TrainingSet in the same thread
  learnInSameThread(TrainingSet trainingSetToLearn, LearningRule learningRule), trains network  with the specified TrainingSet and LearninRule in the same thread
  
  learnInNewThread(TrainingSet trainingSetToLearn), trains network in new thread with the specified TrainingSet
  learnInNewThread(TrainingSet trainingSetToLearn, LearningRule learningRule), trains network in new thread with the specified TrainingSet and LearninRule

The deprecated learn() method trained network in the new thread, and if the call to save() method followed after the call to learn() before the training thread ended, the network gets saved before the training is complete (that was the common issue). So now its safe to do the following:


    nnet.learnInSameThread(someTrainingSet);
    nnet.save("MyNetwork.nnet");

The learnInNewThread() now does the same thing as deprecetad learn() method - trains the network in new thread.
Both methods are overloaded and provide the posibility to specify the learning rule to use. For example:

    nnet.learnInSameThread(someTrainingSet, new BackPropagation());

    setInput(double ... inputArray), method setInput has been overloaded so now it accepts double array as variable-length argument list. This allows you to do:
    
    nnet.setInput(1, 0.5, 0.2);


2. Class LearningRule (and all subclasses)
Added constructor without args, so now you can do
    
    nnet.setLearningRule(new Backpropagation());

Also added getters and setters for the neuralNetwork.


3. Added constructors for MultiLayerPerceptron   

    MultiLayerPerceptron(int ... neuronsInLayers)
    MultiLayerPerceptron(TransferFunctionType transferFunctionType, int ... neuronsInLayers)
    
    
    Now you can create multi layer perceptron with 2, 3, and 1 neurons in layers, and Sigmoid transfer function like this:
    
    MultiLayerPerceptron mlp = new MultiLayerPerceptron(2, 3, 1);
    
    or if you wish to specify the tanh transfer function
    
    MultiLayerPerceptron mlp = new MultiLayerPerceptron(TransferFunctionType.TANH, 2, 3, 1);


4. Class TrainingElement
   Added label and get/setLabel() methods for training elements.
   Sometimes it might be usefull to label some training elements.
   Added constructor with variable-length args,   TrainingElement(double ... input), so now you can do
   
   TrainingElement te = new TrainingElement(1, 0, 1, 0, 1);
   
5. Class SupervisedTrainingElement also got constructor with variable-length args:

   SupervisedTrainingElement(double[] input, double[] desiredOutput) which allows 
   
   SupervisedTrainingElement te = new SupervisedTrainingElement( new double[]{0, 0}, new double[]{1} )


We hope these changes will make your life easier ;)
