static double[] train(int steps) {
        Random rand = new Random();
        double[] w = new double[28 * 28];

        for (int step = 0; step < steps;) {
            step++;
            while(test(w)>0.1){
                int r = rand.nextInt(5000);
                double[] x = I.get(r).vec;
                double z = 0;
                for(int i=0; i<x.length; i++){
                    z+=w[i]*x[i];
                }
                if(z>=0 && I.get(r).characterClass==oppositeChar){
                    for(int n=0; n<w.length; n++){
                        w[n]=w[n]-x[n];
                    }
                }
                if(z<0 && I.get(r).characterClass==targetChar){
                    for(int n=0; n<w.length; n++){
                        w[n]=w[n]+x[n];
                    }
                }
            }    
        }
        return w;
    }