Esempio n. 1
0
        public void compute_squared_distance_larger()
        {
            var points = yinyang.Submatrix(null, 0, 1).ToJagged();

            var X = points.ToMatrix();
            int N = X.Rows();
            int D = X.Columns();

            double[,] expected = new double[N, N];
            TSNEWrapper.computeSquaredEuclideanDistance(X, expected);

            double[][] actual = Jagged.Zeros(N, N);
            TSNE.computeSquaredEuclideanDistance(points, N, D, actual);

            Assert.IsTrue(actual.IsEqual(expected));
        }
Esempio n. 2
0
        public void compute_squared_distance_1()
        {
            double[][] points =
            {
                new double[] { 2, 3, 2 },
                new double[] { 5, 4, 5 },
                new double[] { 9, 6, 4 },
                new double[] { 4, 7, 5 },
                new double[] { 8, 1, 1 },
                new double[] { 1, 2, 4 },
            };

            var X = points.ToMatrix();
            int N = X.Rows();
            int D = X.Columns();

            double[,] expected = new double[N, N];
            TSNEWrapper.computeSquaredEuclideanDistance(X, expected);

            double[][] actual = Jagged.Zeros(N, N);
            TSNE.computeSquaredEuclideanDistance(points, N, D, actual);

            Assert.IsTrue(actual.IsEqual(expected));
        }