public List<Feat> training(int T){
		//initialize weights
		int allPics = features.get(0).valuesFaces.size();
		List<Feat> weakClassifiers = new ArrayList<Feat>();
		for(Feat f : features){
			for(ValueFace vf : f.valuesFaces){
				vf.weight = (double)1/allPics;
			}
			
		}
		//for from 1 .. T
		for(int i = 0; i < T; i++){
			System.out.println(new Date() + " " + i);
			//normalize weights
			for(Feat f : features){
				f.error = 0;
				double allweights = f.getAllweight();
				for(ValueFace vf : f.valuesFaces){
					vf.weight = vf.weight/allweights;
					int y;
					if (vf.face){
						y = 1;
					} else {
						y = 0;
					}
					f.error += (double)vf.weight *Math.abs(f.h(vf.value) - y);
				}
			}
			//select best weak classifier
			Collections.sort(features);
			weakClassifiers.add(features.get(0));
			features.remove(0);
			//define h_t(x)
			//update weights
			for(Feat f : features){
				double beta = (double)(f.error/(1-f.error));
				for(ValueFace vf : f.valuesFaces){
					int y;
					if (vf.face){
						y = 1;
					} else {
						y = 0;
					}
					vf.weight = (double)(vf.weight*Math.pow(beta,(1-Math.abs(f.h(vf.value) - y))));
				}
				
			}
		}
		return weakClassifiers;
	}