public static double TestPrecision(int maxit)
	{
		int size = 32;
		double error = 0.0;
		double accouracy = 0.01;
		int nimagesxpatt = 89;
		int npatt = 36;
		int dir = 1;
		int cpatt = 1;
		
		int[] layers = new int[]{ size*size, size, npatt };
		
		MultiLayerPerceptron net = new MultiLayerPerceptron(layers, 0.6, new SigmoidalTransfer());
		
		/* Learning */
		for(int i = 0; i < maxit; i++)
		{
			for(int k = 1; k < nimagesxpatt; k++)
			{
				for(int j = 1; j < npatt+1; j++)
				{		
					String pattern = "/home/dak/workspace/MultiLayersPerceptronLib/img/patterns/"+j+"/"+k+".png";
					double[] inputs = ImageProcessingBW.loadImage(pattern, size, size);
					
					if(inputs == null)
					{
						System.out.println("Cant find "+pattern);
						continue;
						
					}
					double[] output = new double[npatt];

					for(int l = 0; l < npatt; l++)
						output[l] = 0.0;
					
					output[j-1] = 1.0;
					
					
					// Training
					error = net.backPropagate(inputs, output);
					System.out.println("Error is "+error+" ("+i+" "+j+" "+k+" )");					
				}
			}
		}
		
		System.out.println("Learning completed!");
		
		/* Test */
		int correct = 0;
		
		
		double[] inputs = ImageProcessingBW.loadImage("/home/dak/workspace/MultiLayersPerceptronLib/img/test.png", size, size);
		double[] output = net.execute(inputs);

		int max = 0;
		for(int i = 0; i < npatt; i++)
			if(output[i] > output[max])
			{
				max = i;
			}
		
		System.out.println("Il valore massimo e' "+output[max]+" pattern "+(max+1));
		
		/*
		for(int j = 0; j < npatt; j++)
		{
			for(int k = 1; k < nimagesxpatt; k++)
			{
				double[] inputs = ImageProcessingBW.LoadImage("/home/dak/workspace/MultiLayersPerceptronLib/img/patterns/"+(j+1)+"/"+k+".png", size, size);
				double[] output = net.Execute(inputs);
		
				for(int i = 0; i < npatt; i++)
					if(output[i] > 0.6)
					{
						System.out.println("Il pattern e' il "+(i+1)+" mi attendevo il "+(j+1)+" ("+output[i]+")");
						if(i == j)
							correct++;
					}
			}
		}
		System.out.println(correct+" results correct of "+(npatt*nimagesxpatt));
		*/
		return (double) ((double) (npatt*nimagesxpatt) - (double) correct) / (double) (npatt*nimagesxpatt);
	}