src/main/java/com/xceptance/neodymium/visual/ai/machine_learning/Network.java
/**
     * Check the neural network with already seen pattern for self test, if the
     * {@link Constants #INTENDED_PERCENTAGE_MATCH} is reached the network stop learning. After finished training mode
     * the network will categorize the screenshots in recognized and unrecognized.
     * 
     * @param validationList
     *            ArrayList of patterns which are used for counter example calculation.
     * @param flag
     *            Use of {@link Constants#NETWORK_MODE}.
     * @return selfTest Boolean flag for self test or not.
     */
Check the neural network with already seen pattern for self test, if the
Constants #INTENDED_PERCENTAGE_MATCH is reached the network stop learning. After finished training mode
the network will categorize the screenshots in recognized and unrecognized.

@param validationList
ArrayList of patterns which are used for counter example calculation.
@param flag
Use of  Constants#NETWORK_MODE.
@return selfTest Boolean flag for self test or not.
Check the neural network with already seen pattern for self test if the Constants #INTENDED_PERCENTAGE_MATCH is reached the network stop learning . After finished training mode the network will categorize the screenshots in recognized and unrecognized . @param validationList ArrayList of patterns which are used for counter example calculation . @param flag Use of Constants#NETWORK_MODE . @return selfTest Boolean flag for self test or not .
public boolean onSelfTest(ArrayList<PatternHelper> validationList, Boolean flag)
    {
        if (flag)
        {
            double resultVerification = 0.0;
            for (PatternHelper element : internalList)
            {
                resultVerification += layer.computeSum(element.getPatternList());
            }
            double resultValidation = 0.0;
            for (PatternHelper element : validationList)
            {
                resultValidation += layer.computeSum(element.getPatternList());
            }
            System.out.println("Selftest value training dir: " + (resultVerification / internalList.size()));
            System.out.println("Selftest value validation dir: " + (resultValidation / internalList.size()));
            int validationSize = (validationList.size() != 0 ? validationList.size() : 1);
            if ((resultVerification / internalList.size()) >= Constants.INTENDED_PERCENTAGE_MATCH &&
                resultValidation / validationSize < Constants.INTENDED_PERCENTAGE_MATCH)
            {
                selfTest = false;
                return selfTest;
            }
        }
        return selfTest;
    }
public boolean onSelfTest ( ArrayList < PatternHelper > validationList , Boolean flag ) { if ( flag ) { double resultVerification = 0.0 ; for ( PatternHelper element : internalList ) { resultVerification += layer . computeSum ( element . getPatternList ( ) ) ; } double resultValidation = 0.0 ; for ( PatternHelper element : validationList ) { resultValidation += layer . computeSum ( element . getPatternList ( ) ) ; } System . out . println ( "Selftest value training dir: " + ( resultVerification / internalList . size ( ) ) ) ; System . out . println ( "Selftest value validation dir: " + ( resultValidation / internalList . size ( ) ) ) ; int validationSize = ( validationList . size ( ) != 0 ? validationList . size ( ) : 1 ) ; if ( ( resultVerification / internalList . size ( ) ) >= Constants . INTENDED_PERCENTAGE_MATCH && resultValidation / validationSize < Constants . INTENDED_PERCENTAGE_MATCH ) { selfTest = false ; return selfTest ; } } return selfTest ; }
Check the neural network with already seen pattern for self test, if the
 {@link Constants #INTENDED_PERCENTAGE_MATCH} is reached the network stop learning.
Check the neural network with already seen pattern for self test if the { @link Constants #INTENDED_PERCENTAGE_MATCH } is reached the network stop learning .
// compute the summed value for already seen pattern // compute the summed value for counter examples // check if the summed value for recognition is near the intended barrier // and check if the summed counter example value is under the intended barrier // disable self test for further use // internalList.clear(); // internalUpdateList.clear();