public static void softmax(DenseMatrix64F vector) {

        double[] data = vector.getData();
        double sum = 0;
        double maxAc = - Float.MAX_VALUE;
        for (int i = 0; i < data.length; ++i) {
            if (data[i] > maxAc) maxAc =data[i];
        }
        for (int i = 0; i < data.length; ++i) {
            data[i] = Math.exp(data[i] - maxAc);
            sum += data[i];
        }
        for (int i = 0; i < data.length; ++i) {
            data[i] = data[i] / sum;
        }
    }