public static void sigmoid(DenseMatrix64F vector) {

        double[] data = vector.getData();
        double val;
        for (int i = 0; i < data.length; ++i) {
            val = data[i];
            if (val > 50) val = 50;
            if (val < -50) val = -50;
            data[i] = 1 / (1 + Math.exp(-val));
        }
    }