protected void computeGradient(int[][] index, double[][] block, double[] rTrain, double[] gradient) {
		for (int j = 0; j < block.length; j++) {
			double[] t = block[j];
			int[] idx = index[j];
			gradient[j] = 0;
			for (int i = 0; i < t.length; i++) {
				gradient[j] += rTrain[idx[i]] * t[i];
			}
			gradient[j] /= rTrain.length;
		}
	}