public void calibrate(double[][] independentVars, double[][] targetVars) {
        if (stopped) {
            stopped = false;
            epoch = 0;
            sampleCount = independentVars.length;
            targetCount = targetVars[0].length;
            error = new double[targetCount];
            startTime = nanoTime();
            myNetwork.randomize();
        } else if (paused) {
            paused = false;
            startTime = nanoTime();
        }
        sse = 0d;
        sampleIndex = 0;
        while (true) {
            double[] activation = myNetwork.propagate(independentVars[sampleIndex]);
            double[] target = targetVars[sampleIndex];
            for (int i = 0; i < targetCount; i++) {
                error[i] = target[i] - activation[i];
                sse += error[i] * error[i];
            }
            myNetwork.backPropagate(error);
            if (++sampleIndex == sampleCount) {
                if (learnFromEpoch()) return;
            }
        }
    }