Example #1
0
        public virtual double[][] Revert(double[][] data)
        {
            if (data == null)
            {
                throw new ArgumentNullException("data");
            }

            int rows       = data.Rows();
            int cols       = data.Columns();
            int components = NumberOfOutputs;

            double[][] reversion = Jagged.Zeros(rows, components);

            // Revert the data (reversion = data * eigenVectors.Transpose())
            for (int i = 0; i < components; i++)
            {
                for (int j = 0; j < rows; j++)
                {
                    for (int k = 0; k < cols; k++)
                    {
                        reversion[j][i] += data[j][k] * ComponentVectors[k][i];
                    }
                }
            }


            if (this.Method == PrincipalComponentMethod.Standardize || this.Method == PrincipalComponentMethod.CorrelationMatrix)
            {
                reversion.Multiply(StandardDeviations, dimension: (VectorType)0, result: reversion);
            }

            reversion.Add(Means, dimension: (VectorType)0, result: reversion);
            return(reversion);
        }
Example #2
0
        /// <summary>
        ///   Loads a jagged array from a stream.
        /// </summary>
        ///
        /// <param name="stream">The stream containing the matrix to be loaded.</param>
        /// <param name="trim">Pass true to remove null or empty elements from the loaded array.</param>
        ///
        /// <returns>A jagged array containing the values available in the given stream.</returns>
        ///
        public static Array LoadJagged(Stream stream, bool trim = true)
        {
            using (var reader = new BinaryReader(stream, System.Text.Encoding.ASCII
#if !NET35 && !NET40
                                                 , leaveOpen: true
#endif
                                                 ))
            {
                int   bytes;
                Type  type;
                int[] shape;
                if (!parseReader(reader, out bytes, out type, out shape))
                {
                    throw new FormatException();
                }

                Array matrix = Jagged.Zeros(type, shape);

                if (type == typeof(String))
                {
                    Array result = readStringMatrix(reader, matrix, bytes, type, shape);

                    if (trim)
                    {
                        return(result.Trim());
                    }
                    return(result);
                }

                return(readValueJagged(reader, matrix, bytes, type, shape));
            }
        }
Example #3
0
        private void ComputeInformation(double[][] data, int[] labels)
        {
            // Compute distortion and other metrics regarding the clustering
            if (ComputeCovariances)
            {
                // Compute cluster information (optional)
                Parallel.For(0, clusters.Count, ParallelOptions, i =>
                {
                    double[][] centroids = clusters.Centroids;

                    // Extract the data for the current cluster
                    double[][] sub = data.Get(labels.Find(x => x == i));

                    if (sub.Length > 0)
                    {
                        // Compute the current cluster variance
                        clusters.Covariances[i] = sub.Covariance(centroids[i]);
                    }
                    else
                    {
                        // The cluster doesn't have any samples
                        clusters.Covariances[i] = Jagged.Zeros(Dimension, Dimension);
                    }
                });
            }

            if (ComputeError)
            {
                Error = clusters.Distortion(data);
            }
        }
Example #4
0
        /// <summary>
        /// 学習ボタンクリック
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLearn_Click(object sender, EventArgs e)
        {
            int cntRows = dgvHistory.Rows.Count;

            double[][] input  = Jagged.Zeros(cntRows, 32 * 32);
            int[]      output = new int[cntRows];
            string     tmpCharDigit;

            // グリッドのデータを1行ずつ学習データとして格納
            for (int i = 0; i < cntRows; i++)
            {
                input.SetRow(i, (double[])dgvHistory.Rows[i].Cells["features"].Value);

                tmpCharDigit = dgvHistory.Rows[i].Cells["answer"].Value.ToString();
                output[i]    = int.Parse(tmpCharDigit);
            }

            IKernel kernel;

            kernel = new Polynomial(2, 0.0000);


            kda = new KernelDiscriminantAnalysis(kernel)
            {
                Threshold      = 0.0005,
                Regularization = 0.0001
            };

            Application.DoEvents();

            kda.Learn(input, output);

            btnQuestion.Enabled = true;
        }
Example #5
0
        public void computeGaussianPerplexity_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 },
            };

            double perplexity = 0.5;
            int    N          = points.Length;
            int    D          = 3;

            var X = points.ToMatrix();

            double[,] expected = new double[N, N];
            TSNEWrapper.computeGaussianPerplexity(X, N, D, expected, perplexity);

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

            Assert.IsTrue(actual.IsEqual(expected, rtol: 1e-5));
        }
        /// <summary>
        ///   Converts an image from one representation to another. When
        ///   converting to byte, the <see cref="Max"/> and <see cref="Min"/>
        ///   are ignored.
        /// </summary>
        ///
        /// <param name="input">The input image to be converted.</param>
        /// <param name="output">The converted image.</param>
        ///
        public void Convert(UnmanagedImage input, out byte[][][] output)
        {
            int width     = input.Width;
            int height    = input.Height;
            int pixelSize = input.PixelSize;
            int offset    = input.Offset;

            output = Jagged.Zeros <byte>(height, width, pixelSize);

            if (Channel != 0)
            {
                throw new InvalidOperationException("The Channel property will be ignored when converting to a rank-3 tensor.");
            }

            unsafe
            {
                byte *src = (byte *)input.ImageData.ToPointer();

                for (int y = 0; y < height; y++)
                {
                    for (int x = 0; x < width; x++)
                    {
                        for (int d = 0; d < pixelSize; d++, src++)
                        {
                            output[y][x][d] = (byte)Vector.Scale(*src, (byte)0, (byte)255, Min, Max);
                        }
                    }
                    src += offset;
                }
            }
        }
        /// <summary>
        /// Learns a model that can map the given inputs to the given outputs.
        /// </summary>
        /// <param name="x">The model inputs.</param>
        /// <param name="y">The desired outputs associated with each <paramref name="x">inputs</paramref>.</param>
        /// <param name="weights">The weight of importance for each input-output pair.</param>
        /// <returns>A model that has learned how to produce <paramref name="y" /> given <paramref name="x" />.</returns>
        public MinimumMeanDistanceClassifier Learn(double[][] x, int[] y, double[] weights = null)
        {
            NumberOfInputs  = x.Columns();
            NumberOfOutputs = y.Max() + 1;
            means           = Jagged.Zeros(NumberOfOutputs, NumberOfInputs);

            int[] counts = new int[NumberOfOutputs];

            // Compute the average of the input vectors for each of
            // the output classes. Afterwards, a decision can be cast
            // by checking to which average a new sample is closer.
            for (int i = 0; i < x.Length; i++)
            {
                int      k    = y[i];
                double[] mean = means[k];
                for (int j = 0; j < mean.Length; j++)
                {
                    mean[j] += x[i][j];
                }
                counts[k]++;

                if (Token.IsCancellationRequested)
                {
                    break;
                }
            }

            means.Divide(counts, dimension: 1, result: means);

            return(this);
        }
        /// <summary>
        ///   Converts an image from one representation to another. When
        ///   converting to byte, the <see cref="Max"/> and <see cref="Min"/>
        ///   are ignored.
        /// </summary>
        ///
        /// <param name="input">The input image to be converted.</param>
        /// <param name="output">The converted image.</param>
        ///
        public void Convert(UnmanagedImage input, out Color[][] output)
        {
            int width     = input.Width;
            int height    = input.Height;
            int pixelSize = input.PixelSize;
            int offset    = input.Offset;

            output = Jagged.Zeros <Color>(input.Height, input.Width);

            unsafe
            {
                if (input.PixelFormat == PixelFormat.Format8bppIndexed)
                {
                    byte *src = (byte *)input.ImageData.ToPointer();

                    for (int y = 0; y < height; y++)
                    {
                        for (int x = 0; x < width; x++, src += pixelSize)
                        {
                            output[y][x] = Color.FromArgb(*src, *src, *src);
                        }
                        src += offset;
                    }
                }
                else if (input.PixelFormat == PixelFormat.Format24bppRgb ||
                         input.PixelFormat == PixelFormat.Format32bppRgb)
                {
                    byte *src = (byte *)input.ImageData.ToPointer();

                    for (int y = 0; y < height; y++)
                    {
                        for (int x = 0; x < width; x++, src += pixelSize)
                        {
                            output[y][x] = Color.FromArgb(src[RGB.R], src[RGB.G], src[RGB.B]);
                        }
                        src += offset;
                    }
                }
                else if (input.PixelFormat == PixelFormat.Format32bppArgb)
                {
                    byte *src = (byte *)input.ImageData.ToPointer();

                    for (int y = 0; y < height; y++)
                    {
                        for (int x = 0; x < width; x++, src += pixelSize)
                        {
                            output[y][x] = Color.FromArgb(src[RGB.A], src[RGB.R], src[RGB.G], src[RGB.B]);
                        }
                        src += offset;
                    }
                }
                else
                {
                    throw new UnsupportedImageFormatException("Pixel format is not supported.");
                }
            }
        }
        /// <summary>
        ///   Initializes a new instance of the <see cref="ResponseLayer"/> class.
        /// </summary>
        ///
        public ResponseLayer(int width, int height, int step, int filter)
        {
            this.Width  = width;
            this.Height = height;
            this.Step   = step;
            this.Size   = filter;

            this.Responses = Jagged.Zeros <float>(height, width);
            this.Laplacian = Jagged.Zeros <int>(height, width);
        }
Example #10
0
        public void GetLengthTest()
        {
            var a = Jagged.Zeros(1, 1);
            var b = Matrix.Zeros(1, 1);

            int[] actual   = a.GetLength();
            int[] expected = b.GetLength();

            Assert.IsTrue(actual.IsEqual(expected));
        }
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BasePrincipalComponentAnalysis"/> class.
 /// </summary>
 ///
 public BasePrincipalComponentAnalysis()
 {
     columnMeans          = new double[0];
     columnStdDev         = new double[0];
     eigenvectors         = Jagged.Zeros(0, 0);
     eigenvalues          = new double[0];
     singularValues       = new double[0];
     componentCumulative  = new double[0];
     componentProportions = new double[0];
 }
 /// <summary>
 /// Gets the standard error for each coefficient.
 /// </summary>
 ///
 /// <param name="mse">The overall regression standard error (can be computed from <see cref="GetStandardError(double[][], double[][])"/>.</param>
 /// <param name="informationMatrix">The information matrix obtained when training the model (see <see cref="OrdinaryLeastSquares.GetInformationMatrix()"/>).</param>
 ///
 public double[][] GetStandardErrors(double[] mse, double[][] informationMatrix)
 {
     double[][] se = Jagged.Zeros(NumberOfOutputs, informationMatrix.Length);
     for (int j = 0; j < se.Length; j++)
     {
         for (int i = 0; i < informationMatrix.Length; i++)
         {
             se[j][i] = mse[j] * Math.Sqrt(informationMatrix[i][i]);
         }
     }
     return(se);
 }
        /// <summary>
        ///     This method should be implemented by child classes to initialize
        ///     their fields once the <see cref="BaseLeastSquaresMethod.NumberOfParameters" /> is known.
        /// </summary>
        protected override void Initialize()
        {
            weights  = new double[NumberOfParameters];
            diagonal = new double[NumberOfParameters];
            gradient = new double[NumberOfParameters];

            jacobian = new double[NumberOfParameters][];
            Hessian  = Jagged.Zeros(NumberOfParameters, NumberOfParameters);
            for (var i = 0; i < Hessian.Length; i++)
            {
                Hessian[i] = new double[NumberOfParameters];
            }
        }
        /// <summary>
        ///   Updates the response layer definitions
        ///   without recreating objects.
        /// </summary>
        ///
        public void Update(int width, int height, int step, int filter)
        {
            if (height > Height || width > Width)
            {
                this.Responses = Jagged.Zeros <float>(height, width);
                this.Laplacian = Jagged.Zeros <int>(height, width);
            }

            this.Width  = width;
            this.Height = height;
            this.Step   = step;
            this.Size   = filter;
        }
Example #15
0
        /// <summary>
        /// This method should be implemented by child classes to initialize
        /// their fields once the <see cref="BaseLeastSquaresMethod.NumberOfParameters" /> is known.
        /// </summary>
        ///
        protected override void Initialize()
        {
            this.weights  = new double[NumberOfParameters];
            this.diagonal = new double[NumberOfParameters];
            this.gradient = new double[NumberOfParameters];

            this.jacobian = new double[NumberOfParameters][];
            this.hessian  = Jagged.Zeros(NumberOfParameters, NumberOfParameters);
            for (int i = 0; i < hessian.Length; i++)
            {
                hessian[i] = new double[NumberOfParameters];
            }
        }
Example #16
0
        // Compute gradient of the t-SNE cost function (exact)
        internal static void computeExactGradient(double[][] P, double[][] Y, int N, int D, double[][] dC)
        {
            // Make sure the current gradient contains zeros
            for (int i = 0; i < dC.Length; i++)
            {
                for (int j = 0; j < dC[i].Length; j++)
                {
                    dC[i][j] = 0.0;
                }
            }

            // Compute the squared Euclidean distance matrix
            double[][] DD = Jagged.Create <double>(N, N);
            computeSquaredEuclideanDistance(Y, N, D, DD);

            // Compute Q-matrix and normalization sum
            double[][] Q = Jagged.Zeros(N, N);

            double sum_Q = 0.0;

            for (int n = 0; n < N; n++)
            {
                for (int m = 0; m < N; m++)
                {
                    if (n != m)
                    {
                        Q[n][m] = 1.0 / (1.0 + DD[n][m]);
                        sum_Q  += Q[n][m];
                    }
                }
            }

            // Perform the computation of the gradient
            for (int n = 0; n < N; n++)
            {
                for (int m = 0; m < N; m++)
                {
                    if (n != m)
                    {
                        double mult = (P[n][m] - (Q[n][m] / sum_Q)) * Q[n][m];
                        for (int d = 0; d < D; d++)
                        {
                            dC[n][d] += (Y[n][d] - Y[m][d]) * mult;
                        }
                    }
                }
            }
        }
Example #17
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));
        }
Example #18
0
        public void computeGradient_1()
        {
            Accord.Math.Random.Generator.Seed = 0;

            double perplexity = 0.5;
            double theta      = 0.5;
            int    N          = 100;
            int    K          = (int)(3 * perplexity);
            int    D          = 3;

            uint[]   row_P = Vector.Create(N + 1, new uint[] { 0, 1, 2, 3, 4, 5, 6 });
            uint[]   col_P = Vector.Create(N * K, new uint[] { 5, 3, 1, 1, 2, 1 });
            double[] val_P = Vector.Create(N * K, new double[]
            {
                0.83901046609114708,
                0.39701047304189827,
                0.19501046869768451,
                0.59401047304189827,
                0.49301046869768484,
                0.59901046869768451,
            });

            double[,] P = Matrix.Random(N, N, new NormalDistribution());
            double[][] p = P.ToJagged();

            double[,] Y = Matrix.Random(N, D, new NormalDistribution());
            double[][] y = Y.ToJagged();



            uint[]   expected_row = Vector.Create(row_P);
            uint[]   expected_col = Vector.Create(col_P);
            double[] expected_val = Vector.Create(val_P);
            double[,] expected = Matrix.Zeros(N, D);
            TSNEWrapper.computeGradient(P, expected_row, expected_col, expected_val, Y, N, D, expected, theta);

            int[]      actual_row = row_P.To <int[]>();
            int[]      actual_col = col_P.To <int[]>();
            double[]   actual_val = (double[])val_P.Clone();
            double[][] actual     = Jagged.Zeros(N, D);
            TSNE.computeGradient(p, actual_row, actual_col, actual_val, y, N, D, actual, theta);

            Assert.IsTrue(actual.IsEqual(expected));
            Assert.IsTrue(actual_row.IsEqual(expected_row));
            Assert.IsTrue(actual_col.IsEqual(expected_col));
            Assert.IsTrue(actual_val.IsEqual(expected_val, 1e-4));
        }
Example #19
0
        /// <summary>
        /// Learns a model that can map the given inputs to the given outputs.
        /// </summary>
        /// <param name="x">The model inputs.</param>
        /// <param name="y">The desired outputs associated with each <paramref name="x">inputs</paramref>.</param>
        /// <param name="weights">The weight of importance for each input-output pair.</param>
        /// <returns>
        /// A model that has learned how to produce <paramref name="y" /> given <paramref name="x" />.
        /// </returns>
        public PolynomialRegression Learn(double[] x, double[] y, double[] weights = null)
        {
            double[][] z = Jagged.Zeros(x.Length, Degree);

            for (int i = 0; i < x.Length; i++)
            {
                for (int j = 0; j < z[i].Length; j++)
                {
                    z[i][j] = Math.Pow(x[i], Degree - j - 1);
                }
            }

            var lls    = new OrdinaryLeastSquares();
            var linear = lls.Learn(z, y, weights);

            return(new PolynomialRegression(linear));
        }
Example #20
0
        public void computeGaussianPerplexity_larger()
        {
            var points = yinyang.Submatrix(null, 0, 1).ToJagged();

            double perplexity = 0.5;
            int    N          = points.Rows();
            int    D          = points.Columns();

            var X = points.ToMatrix();

            double[,] expected = new double[N, N];
            TSNEWrapper.computeGaussianPerplexity(X, N, D, expected, perplexity);

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

            Assert.IsTrue(actual.IsEqual(expected, rtol: 1e-5));
        }
Example #21
0
        public void CreateJaggedTest()
        {
            Array jagged = Jagged.Zeros(typeof(int), 2, 3, 1);

            foreach (var idx in jagged.GetIndices(deep: true))
            {
                Assert.AreEqual(0, jagged.GetValue(deep: true, indices: idx));
                jagged.SetValue(idx.Sum(), deep: true, indices: idx);
            }

            int[][][] expected =
            {
                new int[][] { new[] { 0 }, new[] { 1 }, new[] { 2 } },
                new int[][] { new[] { 1 }, new[] { 2 }, new[] { 3 } }
            };

            Assert.IsTrue(expected.IsEqual(jagged));
        }
Example #22
0
        private void innerComputeCovariance(double[][] data, int[] labels, int i)
        {
            double[][] centroids = clusters.Centroids;

            // Extract the data for the current cluster
            double[][] sub = data.Get(labels.Find(x => x == i));

            if (sub.Length > 0)
            {
                // Compute the current cluster variance
                clusters.Covariances[i] = sub.Covariance(centroids[i]);
            }
            else
            {
                // The cluster doesn't have any samples
                clusters.Covariances[i] = Jagged.Zeros(Dimension, Dimension);
            }
        }
Example #23
0
        public double Distance(
            double[] meanX, double[][] covX, double lnDetCovX,
            double[] meanY, double[][] covY, double lnDetCovY)
        {
            int n = meanX.Length;

            // P = (covX + covY) / 2
            var P = Jagged.Zeros(n, n);

            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    P[i][j] = (covX[i][j] + covY[i][j]) / 2.0;
                }
            }

            var    svd  = new JaggedSingularValueDecomposition(P);
            double detP = svd.LogPseudoDeterminant;

            double[] d = new double[meanX.Length];
            for (int i = 0; i < meanX.Length; i++)
            {
                d[i] = meanX[i] - meanY[i];
            }

            double[] z = svd.Solve(d);

            double r = 0.0;

            for (int i = 0; i < d.Length; i++)
            {
                r += d[i] * z[i];
            }

            double mahalanobis = Math.Abs(r);

            double a = (1.0 / 8.0) * mahalanobis;
            double b = (0.5) * (detP - 0.5 * (lnDetCovX + lnDetCovY));

            return(a + b);
        }
Example #24
0
        public void pinv_precision()
        {
            // Inaccuracy in Accord.Math Pseudoinverse
            // https://github.com/accord-net/framework/issues/313

            int nPoly = 5;

            double[] t = { 1352, 1354, 1356, 1358, 1360, 1362, 1364, 1366, 1368, 1370, 1372, 1374, 1376, 1378, 1380, 1382, 1384, 1386, 1388, 1390, 1392, 1394, 1396, 1398, 1400, 1402, 1404, 1406, 1408, 1410, 1412, 1414, 1416, 1418, 1420, 1422, 1424, 1426, 1428, 1430, 1432, 1434, 1436, 1438, 1440, 1442, 1444, 1446, 1448, 1450, 1452, 1454, 1456, 1458, 1460, 1462, 1464, 1466, 1468, 1470, 1472, 1474, 1476, 1478, 1480, 1482, 1484, 1486, 1488, 1490, 1492, 1494, 1496, 1498, 1500, 1502, 1504, 1506, 1508, 1510, 1512, 1514, 1516, 1518, 1520, 1522, 1524, 1526, 1528, 1530, 1532, 1534, 1536, 1538, 1540, 1542, 1544, 1546, 1548, 1550, 1552, 1554, 1556, 1558, 1560, 1562, 1564, 1566, 1568, 1570, 1572, 1574, 1576, 1578, 1580, 1582, 1584, 1586, 1588, 1590, 1592, 1594, 1596, 1598, 1600, 1602, 1604, 1606, 1608, 1610, 1612, 1614, 1616, 1618, 1620, 1622, 1624, 1626, 1628, 1630, 1632, 1634, 1636, 1638, 1640, 1642, 1644, 1646, 1648, 1650, 1652, 1654, 1656, 1658, 1660, 1662, 1664, 1666, 1668, 1670, 1672, 1674, 1676, 1678, 1680, 1682, 1684, 1686, 1688, 1690, 1692, 1694, 1696, 1698, 1700, 1702 };

            //Generating the Matrix
            var sPoly = Jagged.Zeros(t.Length, nPoly + 1);

            for (int ii = 0; ii < t.Length; ii++)
            {
                for (int jj = 0; jj < nPoly + 1; jj++)
                {
                    sPoly[ii][jj] = Math.Pow(t[ii], jj);
                }
            }

            // B = (repmat(A, [6 1])' .^ repmat([0 1 2 3 4 5], [176 1])')';

            var jagged = sPoly.PseudoInverse();
            var multi  = sPoly.ToMatrix().PseudoInverse();

            Assert.IsTrue(jagged.IsEqual(multi, rtol: 1e-15));

            var R = sPoly.Dot(sPoly.PseudoInverse()).Dot(sPoly);

            Assert.IsTrue(R.IsEqual(sPoly, rtol: 1e-2));

            var expected = Jagged.Parse(
                @"1,20125654080206e-10	1,13236875425253e-10	1,06499525384608e-10	9,99130864205866e-11	9,34770208386440e-11	8,71907706948343e-11	8,10537577032779e-11	7,50653831433932e-11	6,92250277671434e-11	6,35320517062416e-11	5,79857943794106e-11	5,25855743996096e-11	4,73306894812560e-11	4,22204163474767e-11	3,72540106373263e-11	3,24307068130343e-11	2,77497180672282e-11	2,32102362301744e-11	1,88114316770077e-11	1,45524532349703e-11	1,04324280906333e-11	6,45046169714632e-12	2,60563768146295e-12	-1,10298224842723e-12	-4,67635839626088e-12	-8,11547317026788e-12	-1,14213311759389e-11	-1,45949593087919e-11	-1,76374068471365e-11	-2,05497455448409e-11	-2,33330697240993e-11	-2,59884963681969e-11	-2,85171652142769e-11	-3,09202388461059e-11	-3,31989027868412e-11	-3,53543655917962e-11	-3,73878589412074e-11	-3,93006377329998e-11	-4,10939801755535e-11	-4,27691878804715e-11	-4,43275859553419e-11	-4,57705230965095e-11	-4,70993716818365e-11	-4,83155278634700e-11	-4,94204116606227e-11	-5,04154670523102e-11	-5,13021620701284e-11	-5,20819888910602e-11	-5,27564639301726e-11	-5,33271279334232e-11	-5,37955460704241e-11	-5,41633080272011e-11	-5,44320280989654e-11	-5,46033452828767e-11	-5,46789233708086e-11	-5,46604510421157e-11	-5,45496419564068e-11	-5,43482348462939e-11	-5,40579936101794e-11	-5,36807074050045e-11	-5,32181907390288e-11	-5,26722835645903e-11	-5,20448513708693e-11	-5,13377852766609e-11	-5,05530021231306e-11	-4,96924445665998e-11	-4,87580811712940e-11	-4,77519065021133e-11	-4,66759412174044e-11	-4,55322321617232e-11	-4,43228524585961e-11	-4,30499016032976e-11	-4,17155055556059e-11	-4,03218168325726e-11	-3,88710146012934e-11	-3,73653047716700e-11	-3,58069200891727e-11	-3,41981202276171e-11	-3,25411918819205e-11	-3,08384488608699e-11	-2,90922321798968e-11	-2,73049101538303e-11	-2,54788784896716e-11	-2,36165603793564e-11	-2,17204065925394e-11	-1,97928955693198e-11	-1,78365335130464e-11	-1,58538544830699e-11	-1,38474204875072e-11	-1,18198215760058e-11	-9,77367593251373e-12	-7,71162996805381e-12	-5,63635841347974e-12	-3,55056441223311e-12	-1,45697961313079e-12	6,41635736882014e-13	2,74249269994829e-12	4,84277355457573e-12	6,93963170281285e-12	9,03019157752643e-12	1,11115485496153e-11	1,31807688352538e-11	1,52348894031179e-11	1,72709178816158e-11	1,92858324661383e-11	2,12765818262735e-11	2,32400850130568e-11	2,51732313661905e-11	2,70728804212796e-11	2,89358618170864e-11	3,07589752027302e-11	3,25389901449449e-11	3,42726460353122e-11	3,59566519974801e-11	3,75876867944076e-11	3,91623987356027e-11	4,06774055843480e-11	4,21292944649313e-11	4,35146217698901e-11	4,48299130672410e-11	4,60716630077087e-11	4,72363352319677e-11	4,83203622778644e-11	4,93201454876667e-11	5,02320549152725e-11	5,10524292335010e-11	5,17775756412421e-11	5,24037697707461e-11	5,29272555948617e-11	5,33442453342341e-11	5,36509193645639e-11	5,38434261238361e-11	5,39178820195501e-11	5,38703713359588e-11	5,36969461412982e-11	5,33936261950206e-11	5,29563988550328e-11	5,23812189849263e-11	5,16640088612107e-11	5,08006580805500e-11	4,97870234669942e-11	4,86189289792142e-11	4,72921656177351e-11	4,58024913321697e-11	4,41456309284536e-11	4,23172759760761e-11	4,03130847153169e-11	3,81286819644788e-11	3,57596590271200e-11	3,32015735992926e-11	3,04499496767691e-11	2,75002774622815e-11	2,43480132727534e-11	2,09885794465332e-11	1,74173642506307e-11	1,36297217879454e-11	9,62097190452815e-12	5,38640009672351e-12	9,21257418547607e-13	-3,77923961121101e-12	-8,71990910167333e-12	-1,39056038826638e-11	-1,93412115974937e-11	-2,50316547957003e-11	-3,09818910258252e-11	-3,71969129281858e-11	-4,36817483276290e-11	-5,04414603263060e-11	-5,74811473964377e-11	-6,48059434730755e-11	-7,24210180468779e-11	-8,03315762568666e-11	-8,85428589831914e-11	-9,70601429399206e-11	-1,05888740767766e-10	-1,15034001126881e-10
7,31883974043541e-08	6,89913033650384e-08	6,48864695308964e-08	6,08735805841603e-08	5,69523089261863e-08	5,31223146210725e-08	4,93832453392821e-08	4,57347363011228e-08	4,21764102202352e-08	3,87078772470566e-08	3,53287349123175e-08	3,20385680705176e-08	2,88369488433999e-08	2,57234365634416e-08	2,26975777173256e-08	1,97589058894296e-08	1,69069417052999e-08	1,41411927751371e-08	1,14611536372736e-08	8,86630570165802e-09	6,35611719332825e-09	3,93004309590195e-09	1,58752509505224e-09	-6,72008478012731e-10	-2,84914270306646e-09	-4,94447612738389e-09	-6,95862082226140e-09	-8,89220243953631e-09	-1,07458602681048e-08	-1,25202472904420e-08	-1,42160302391212e-08	-1,58338896533335e-08	-1,73745199354062e-08	-1,88386294073226e-08	-2,02269403672413e-08	-2,15401891460153e-08	-2,27791261637114e-08	-2,39445159861293e-08	-2,50371373813206e-08	-2,60577833761095e-08	-2,70072613126093e-08	-2,78863929047450e-08	-2,86960142947691e-08	-2,94369761097819e-08	-3,01101435182590e-08	-3,07163962865535e-08	-3,12566288354220e-08	-3,17317502965679e-08	-3,21426845691194e-08	-3,24903703761726e-08	-3,27757613213095e-08	-3,29998259451134e-08	-3,31635477816908e-08	-3,32679254151891e-08	-3,33139725363154e-08	-3,33027179988561e-08	-3,32352058762006e-08	-3,31124955178498e-08	-3,29356616059484e-08	-3,27057942117929e-08	-3,24239988523594e-08	-3,20913965468189e-08	-3,17091238730550e-08	-3,12783330241872e-08	-3,08001918650835e-08	-3,02758839888914e-08	-2,97066087735462e-08	-2,90935814382930e-08	-2,84380331002090e-08	-2,77412108307212e-08	-2,70043777121222e-08	-2,62288128940963e-08	-2,54158116502326e-08	-2,45666854345462e-08	-2,36827619380002e-08	-2,27653851450220e-08	-2,18159153900210e-08	-2,08357294139138e-08	-1,98262204206373e-08	-1,87887981336692e-08	-1,77248888525529e-08	-1,66359355094080e-08	-1,55233977254550e-08	-1,43887518675323e-08	-1,32334911046261e-08	-1,20591254643656e-08	-1,08671818895653e-08	-9,65920429473581e-09	-8,43675362260229e-09	-7,20140790062221e-09	-5,95476229750707e-09	-4,69842917974651e-09	-3,43403816812127e-09	-2,16323619421695e-09	-8,87687556956063e-10	3,90926020890712e-10	1,67090533617476e-09	2,95053364887635e-09	4,22807662555026e-09	5,50178228283311e-09	6,76988093091199e-09	8,03058511701101e-09	9,28208956886756e-09	1,05225711382110e-08	1,17501887442535e-08	1,29630833171593e-08	1,41593777415354e-08	1,53371767999032e-08	1,64945671161813e-08	1,76296170991781e-08	1,87403768860525e-08	1,98248782858086e-08	2,08811347227766e-08	2,19071411800839e-08	2,29008741431426e-08	2,38602915431329e-08	2,47833327004788e-08	2,56679182683270e-08	2,65119501760340e-08	2,73133115726445e-08	2,80698667703691e-08	2,87794611880696e-08	2,94399212947331e-08	3,00490545529623e-08	3,06046493624403e-08	3,11044750034474e-08	3,15462815802896e-08	3,19277999648139e-08	3,22467417398911e-08	3,25007991428757e-08	3,26876450091010e-08	3,28049327153576e-08	3,28502961233717e-08	3,28213495232890e-08	3,27156875771527e-08	3,25308852623844e-08	3,22644978152675e-08	3,19140606744252e-08	3,14770894243015e-08	3,09510797386437e-08	3,03335073239811e-08	2,96218278631074e-08	2,88134769585600e-08	2,79058700761017e-08	2,68964024882018e-08	2,57824492175149e-08	2,45613649803636e-08	2,32304841302189e-08	2,17871206011795e-08	2,02285678514559e-08	1,85520988068464e-08	1,67549658042214e-08	1,48344005350031e-08	1,27876139886454e-08	1,06117963961170e-08	8,30411717337864e-09	5,86172486488058e-09	3,28174708698806e-09	5,61290471549523e-10	-2,30255939070347e-09	-5,31273800662419e-09	-8,47220203718680e-09	-1,17839293540161e-08	-1,52509190958904e-08	-1,88761917252678e-08	-2,26627890848090e-08	-2,66137744538887e-08	-3,07322326051202e-08	-3,50212698608739e-08	-3,94840141497937e-08	-4,41236150633219e-08	-4,89432439122131e-08	-5,39460937830519e-08	-5,91353795947871e-08	-6,45143381552260e-08	-7,00862282175738e-08
2,77918229514777e-05	2,61980608741685e-05	2,46393327544523e-05	2,31155188567502e-05	2,16264947820677e-05	2,01721314465848e-05	1,87522950602477e-05	1,73668471053064e-05	1,60156443148558e-05	1,46985386513669e-05	1,34153772852309e-05	1,21660025732951e-05	1,09502520373989e-05	9,76795834291492e-06	8,61894927728379e-06	7,50304772855525e-06	6,42007166392353e-06	5,36983410826692e-06	4,35214312268483e-06	3,36680178303682e-06	2,41360815847787e-06	1,49235528999986e-06	6,02831168967734e-07	-2,55181284343090e-07	-1,08190424220775e-06	-1,87756499091422e-06	-2,64239595222559e-06	-3,37663470484228e-06	-4,08052400586354e-06	-4,75431181224981e-06	-5,39825130228482e-06	-6,01260089703764e-06	-6,59762428182462e-06	-7,15359042767147e-06	-7,68077361277539e-06	-8,17945344396704e-06	-8,64991487817273e-06	-9,09244824387628e-06	-9,50734926258108e-06	-9,89491907027261e-06	-1,02554642388795e-05	-1,05892967977369e-05	-1,08967342550470e-05	-1,11780996193418e-05	-1,14337214209480e-05	-1,16639337334427e-05	-1,18690761951182e-05	-1,20494940304526e-05	-1,22055380715570e-05	-1,23375647796459e-05	-1,24459362664991e-05	-1,25310203159224e-05	-1,25931904052102e-05	-1,26328257266074e-05	-1,26503112087713e-05	-1,26460375382334e-05	-1,26204011808634e-05	-1,25738044033271e-05	-1,25066552945535e-05	-1,24193677871923e-05	-1,23123616790797e-05	-1,21860626546983e-05	-1,20409023066393e-05	-1,18773181570652e-05	-1,16957536791703e-05	-1,14966583186464e-05	-1,12804875151410e-05	-1,10477027237207e-05	-1,07987714363338e-05	-1,05341672032722e-05	-1,02543696546320e-05	-9,95986452177812e-06	-9,65114365880415e-06	-9,32870506399498e-06	-8,99305290128990e-06	-8,64469752174370e-06	-8,28415548498792e-06	-7,91194958069523e-06	-7,52860885003927e-06	-7,13466860715701e-06	-6,73067046061297e-06	-6,31716233485798e-06	-5,89469849169337e-06	-5,46383955173198e-06	-5,02515251586449e-06	-4,57921078671209e-06	-4,12659419009743e-06	-3,66788899650344e-06	-3,20368794253511e-06	-2,73459025238086e-06	-2,26120165927561e-06	-1,78413442696467e-06	-1,30400737116338e-06	-8,21445881017073e-07	-3,37081940567995e-07	1,48445849785682e-07	6,34492251823822e-07	1,12040536805217e-06	1,60552662022699e-06	2,08919072790306e-06	2,57072568696708e-06	3,04945274817778e-06	3,52468639570219e-06	3,99573432565280e-06	4,46189742462936e-06	4,92246974825243e-06	5,37673849970512e-06	5,82398400826768e-06	6,26347970785599e-06	6,69449211556432e-06	7,11628081019542e-06	7,52809841080389e-06	7,92919055523414e-06	8,31879587865472e-06	8,69614599209878e-06	9,06046546100309e-06	9,41097178374403e-06	9,74687537017483e-06	1,00673795201660e-05	1,03716804021423e-05	1,06589670316196e-05	1,09284212497445e-05	1,11792177018298e-05	1,14105238158962e-05	1,16214997812039e-05	1,18112985268044e-05	1,19790657000587e-05	1,21239396451882e-05	1,22450513818137e-05	1,23415245834851e-05	1,24124755562249e-05	1,24570132170656e-05	1,24742390725861e-05	1,24632471974514e-05	1,24231242129496e-05	1,23529492655291e-05	1,22517940053385e-05	1,21187225647629e-05	1,19527915369623e-05	1,17530499544098e-05	1,15185392674294e-05	1,12482933227338e-05	1,09413383419626e-05	1,05966929002199e-05	1,02133679046130e-05	9,79036657278901e-06	9,32668441147418e-06	8,82130919501110e-06	8,27322094389661e-06	7,68139190332065e-06	7,04478652170268e-06	6,36236142923078e-06	5,63306541639928e-06	4,85583941254646e-06	4,02961646439329e-06	3,15332171458010e-06	2,22587238021083e-06	1,24617773137007e-06	2,13139069694174e-07	-8,74350293121485e-07	-2,01740505676506e-06	-3,21714795377669e-06	-4,47470977101451e-06	-5,79122937111045e-06	-7,16785371393506e-06	-8,60573787806081e-06	-1,01060450822212e-05	-1,16699467067747e-05	-1,32986223151670e-05	-1,49932596753912e-05	-1,67550547814527e-05	-1,85852118748287e-05	-2,04849434659302e-05	-2,24554703555692e-05	-2,44980216564116e-05	-2,66138348144467e-05
-5,36927638196571e-08	-5,05835453193519e-08	-4,75430763381352e-08	-4,45711193042526e-08	-4,16674274700204e-08	-3,88317448697322e-08	-3,60638062775703e-08	-3,33633371654086e-08	-3,07300536606234e-08	-2,81636625038851e-08	-2,56638610069745e-08	-2,32303370105835e-08	-2,08627688421156e-08	-1,85608252734971e-08	-1,63241654789752e-08	-1,41524389929288e-08	-1,20452856676676e-08	-1,00023356312407e-08	-8,02320924523866e-09	-6,10751706260049e-09	-4,25485978541284e-09	-2,46482822272169e-09	-7,37003248333106e-10	9,29044241383013e-10	2,53375336968652e-09	4,07757332166281e-09	5,56096338641885e-09	6,98439299927881e-09	8,34834178397846e-09	9,65329959486127e-09	1,08997665590739e-08	1,20882531187617e-08	1,32192800732638e-08	1,42933786213089e-08	1,53110904032103e-08	1,62729675430620e-08	1,71795726909337e-08	1,80314790650662e-08	1,88292704940668e-08	1,95735414591058e-08	2,02648971361097e-08	2,09039534379594e-08	2,14913370566828e-08	2,20276855056513e-08	2,25136471617812e-08	2,29498813077165e-08	2,33370581740293e-08	2,36758589814332e-08	2,39669759829480e-08	2,42111125061130e-08	2,44089829951815e-08	2,45613130533131e-08	2,46688394847713e-08	2,47323103371181e-08	2,47524849434086e-08	2,47301339643867e-08	2,46660394306845e-08	2,45609947850089e-08	2,44158049243473e-08	2,42312862421545e-08	2,40082666705546e-08	2,37475857225332e-08	2,34500945341321e-08	2,31166559066474e-08	2,27481443488203e-08	2,23454461190408e-08	2,19094592675358e-08	2,14410936785656e-08	2,09412711126225e-08	2,04109252486244e-08	1,98510017261081e-08	1,92624581874298e-08	1,86462643199556e-08	1,80034018982588e-08	1,73348648263174e-08	1,66416591797068e-08	1,59248032477949e-08	1,51853275759410e-08	1,44242750076878e-08	1,36427007269568e-08	1,28416723002483e-08	1,20222697188304e-08	1,11855854409386e-08	1,03327244339690e-08	9,46480421668258e-09	8,58295490138174e-09	7,68831923612357e-09	6,78205264690884e-09	5,86532327987682e-09	4,93931204349952e-09	4,00521265077908e-09	3,06423166144678e-09	2,11758852415385e-09	1,16651561866270e-09	2,12258298052036e-10	-7,43925069093744e-10	-1,70076305648125e-09	-2,65697113793208e-09	-3,61125164516123e-09	-4,56229372560143e-09	-5,50877330019871e-09	-6,44935302122125e-09	-7,38268223006062e-09	-8,30739691503478e-09	-9,22211966920019e-09	-1,01254596481478e-08	-1,10160125278149e-08	-1,18923604622833e-08	-1,27530720415847e-08	-1,35967022495149e-08	-1,44217924214228e-08	-1,52268702020256e-08	-1,60104495032136e-08	-1,67710304618471e-08	-1,75070993975668e-08	-1,82171287705994e-08	-1,88995771395590e-08	-1,95528891192503e-08	-2,01754953384775e-08	-2,07658123978475e-08	-2,13222428275718e-08	-2,18431750452749e-08	-2,23269833137936e-08	-2,27720276989886e-08	-2,31766540275377e-08	-2,35391938447666e-08	-2,38579643724146e-08	-2,41312684664656e-08	-2,43573945749532e-08	-2,45346166957504e-08	-2,46611943343848e-08	-2,47353724618411e-08	-2,47553814723641e-08	-2,47194371412656e-08	-2,46257405827272e-08	-2,44724782076042e-08	-2,42578216812328e-08	-2,39799278812325e-08	-2,36369388553108e-08	-2,32269817790687e-08	-2,27481689138046e-08	-2,21985975643189e-08	-2,15763500367188e-08	-2,08794935962223e-08	-2,01060804249641e-08	-1,92541475797980e-08	-1,83217169501031e-08	-1,73067952155883e-08	-1,62073738040955e-08	-1,50214288494070e-08	-1,37469211490460e-08	-1,23817961220844e-08	-1,09239837669460e-08	-9,37139861921087e-09	-7,72193970942164e-09	-5,97349052088517e-09	-4,12391894748971e-09	-2,17107725146830e-09	-1,12802021268543e-10	2,05308587070321e-09	4,32878131023892e-09	6,71649498353691e-09	9,21845341940516e-09	1,18368990314444e-08	1,45740901602488e-08	1,74323011156045e-08	2,04138222186783e-08	2,35209598442181e-08	2,67560364627472e-08	3,01213906827574e-08	3,36193772929094e-08	3,72523673042234e-08	4,10227479922742e-08	4,49329229393972e-08	4,89853120768653e-08	5,31823517270996e-08
3,45065614390385e-11	3,24899076858601e-11	3,05181038660469e-11	2,85909932898718e-11	2,67084132653294e-11	2,48701950706236e-11	2,30761639266580e-11	2,13261389694556e-11	1,96199332225836e-11	1,79573535695659e-11	1,63382007263114e-11	1,47622692135324e-11	1,32293473291625e-11	1,17392171207817e-11	1,02916543580334e-11	8,88642850504858e-12	7,52330269286359e-12	6,20203369184305e-12	4,92237188409934e-12	3,68406123591484e-12	2,48683927015919e-12	1,33043703871464e-12	2,14579094894467e-13	-8,61016534136886e-13	-1,89663837494180e-12	-2,89258153538895e-12	-3,84914773223292e-12	-4,76664531869355e-12	-5,64538931203452e-12	-6,48570142114299e-12	-7,28791007410888e-12	-8,05235044580408e-12	-8,77936448546162e-12	-9,46930094425484e-12	-1,01225154028768e-11	-1,07393702991195e-11	-1,13202349554530e-11	-1,18654856066048e-11	-1,23755054271386e-11	-1,28506845590348e-11	-1,32914201392679e-11	-1,36981163273875e-11	-1,40711843330961e-11	-1,44110424438282e-11	-1,47181160523344e-11	-1,49928376842518e-11	-1,52356470256866e-11	-1,54469909508051e-11	-1,56273235493928e-11	-1,57771061544452e-11	-1,58968073697467e-11	-1,59869030974476e-11	-1,60478765656447e-11	-1,60802183559601e-11	-1,60844264311197e-11	-1,60610061625332e-11	-1,60104703578749e-11	-1,59333392886581e-11	-1,58301407178204e-11	-1,57014099272979e-11	-1,55476897456080e-11	-1,53695305754272e-11	-1,51674904211695e-11	-1,49421349165672e-11	-1,46940373522475e-11	-1,44237787033170e-11	-1,41319476569358e-11	-1,38191406398979e-11	-1,34859618462124e-11	-1,31330232646811e-11	-1,27609447064771e-11	-1,23703538327265e-11	-1,19618861820852e-11	-1,15361851983186e-11	-1,10939022578827e-11	-1,06356966975016e-11	-1,01622358417458e-11	-9,67419503061489e-12	-9,17225764711317e-12	-8,65711514482990e-12	-8,12946707552106e-12	-7,59002111668443e-12	-7,03949309914159e-12	-6,47860703461572e-12	-5,90809514331643e-12	-5,32869788150695e-12	-4,74116396909470e-12	-4,14625041720650e-12	-3,54472255576735e-12	-2,93735406107887e-12	-2,32492698339980e-12	-1,70823177452762e-12	-1,08806731537468e-12	-4,65240943544740e-13	1,59431519081490e-13	7,85125738771071e-13	1,41100884235446e-12	2,03623938965896e-12	2,65996734591241e-12	3,28133405417689e-12	3,89947220776354e-12	4,51350582265623e-12	5,12255020993007e-12	5,72571194817120e-12	6,32208885590250e-12	6,91076996399871e-12	7,49083548811203e-12	8,06135680108861e-12	8,62139640538997e-12	9,17000790551998e-12	9,70623598043548e-12	1,02291163559741e-11	1,07376757772749e-11	1,12309319811947e-11	1,17078936687316e-11	1,21675604774480e-11	1,26089229538877e-11	1,30309625259968e-11	1,34326514755469e-11	1,38129529105551e-11	1,41708207377031e-11	1,45051996347603e-11	1,48150250230010e-11	1,50992230396304e-11	1,53567105101971e-11	1,55863949210315e-11	1,57871743916414e-11	1,59579376471494e-11	1,60975639907146e-11	1,62049232759431e-11	1,62788758793164e-11	1,63182726726102e-11	1,63219549953145e-11	1,62887546270559e-11	1,62174937600169e-11	1,61069849713567e-11	1,59560311956330e-11	1,57634256972224e-11	1,55279520427401e-11	1,52483840734622e-11	1,49234858777455e-11	1,45520117634485e-11	1,41327062303522e-11	1,36643039425808e-11	1,31455297010229e-11	1,25750984157511e-11	1,19517150784441e-11	1,12740747348066e-11	1,05408624569904e-11	9,75075331601567e-12	8,90241235419025e-12	7,99449455753174e-12	7,02564482818776e-12	5,99449795685653e-12	4,89967859520859e-12	3,73980122830590e-12	2,51347014703077e-12	1,21927942047967e-12	-1,44187131573326e-13	-1,57835596629525e-12	-3,08466384534839e-12	-4,66455786247777e-12	-6,31949547109551e-12	-8,05094451185196e-12	-9,86038324021851e-12	-1,17493003540686e-11	-1,37191950212527e-11	-1,57715769071808e-11	-1,79079662024010e-11	-2,01298936501769e-11	-2,24389005740703e-11	-2,48365389055175e-11	-2,73243712114077e-11	-2,99039707216697e-11	-3,25769213568389e-11	-3,53448177556461e-11
-7,37728940289735e-15	-6,94237890949644e-15	-6,51719566548630e-15	-6,10170531805266e-15	-5,69587220905054e-15	-5,29965936902578e-15	-4,91302851123714e-15	-4,53594002566322e-15	-4,16835297301032e-15	-3,81022507871766e-15	-3,46151272696612e-15	-3,12217095468475e-15	-2,79215344555717e-15	-2,47141252402962e-15	-2,15989914931705e-15	-1,85756290941105e-15	-1,56435201508619e-15	-1,28021329390751e-15	-1,00509218423732e-15	-7,38932729242515e-16	-4,81677570900923e-16	-2,33267944009298e-16	6,35632981013670e-18	2,37256848102776e-16	4,59496633574320e-16	6,73140140083787e-16	8,78253258636542e-16	1,07490332337729e-15	1,26315911758289e-15	1,44309087965537e-15	1,61477030911495e-15	1,77827057259295e-15	1,93366630982473e-15	2,08103363964266e-15	2,22045016596911e-15	2,35199498380936e-15	2,47574868524460e-15	2,59179336542486e-15	2,70021262856192e-15	2,80109159392247e-15	2,89451690182070e-15	2,98057671961170e-15	3,05936074768397e-15	3,13096022545254e-15	3,19546793735278e-15	3,25297821883155e-15	3,30358696234086e-15	3,34739162333342e-15	3,38449122625114e-15	3,41498637052073e-15	3,43897923654642e-15	3,45657359170254e-15	3,46787479632679e-15	3,47298980971301e-15	3,47202719610406e-15	3,46509713068485e-15	3,45231140557576e-15	3,43378343582446e-15	3,40962826540022e-15	3,37996257318571e-15	3,34490467897085e-15	3,30457454944534e-15	3,25909380419147e-15	3,20858572167747e-15	3,15317524524980e-15	3,09298898912733e-15	3,02815524439316e-15	2,95880398498782e-15	2,88506687370260e-15	2,80707726817230e-15	2,72497022686787e-15	2,63888251509003e-15	2,54895261096162e-15	2,45532071142077e-15	2,35812873821409e-15	2,25752034388939e-15	2,15364091778840e-15	2,04663759204041e-15	1,93665924755454e-15	1,82385652001286e-15	1,70838180586391e-15	1,59038926831475e-15	1,47003484332450e-15	1,34747624559703e-15	1,22287297457509e-15	1,09638632043066e-15	9,68179370060387e-16	8,38417013077650e-16	7,07265947805413e-16	5,74894687269025e-16	4,41473565189443e-16	3,07174741976702e-16	1,72172210722207e-16	3,66418031910999e-17	-9,92388041834178e-17	-2,35290084307984e-16	-3,71330653435001e-16	-5,07177265172445e-16	-6,42644804487184e-16	-7,77546281714843e-16	-9,11692826565559e-16	-1,04489368213164e-15	-1,17695619889415e-15	-1,30768582872969e-15	-1,43688611891857e-15	-1,56435870615058e-15	-1,68990331053313e-15	-1,81331772959732e-15	-1,93439783230516e-15	-2,05293755305793e-15	-2,16872888570105e-15	-2,28156187753266e-15	-2,39122462331061e-15	-2,49750325925851e-15	-2,60018195707352e-15	-2,69904291793363e-15	-2,79386636650420e-15	-2,88443054494478e-15	-2,97051170691685e-15	-3,05188411159060e-15	-3,12832001765167e-15	-3,19958967730865e-15	-3,26546133029944e-15	-3,32570119789929e-15	-3,38007347692619e-15	-3,42834033375166e-15	-3,47026189830234e-15	-3,50559625807063e-15	-3,53409945212201e-15	-3,55552546509981e-15	-3,56962622123385e-15	-3,57615157834717e-15	-3,57484932186284e-15	-3,56546515881137e-15	-3,54774271183744e-15	-3,52142351320695e-15	-3,48624699881434e-15	-3,44195050218936e-15	-3,38826924850416e-15	-3,32493634858045e-15	-3,25168279289642e-15	-3,16823744559386e-15	-3,07432703848516e-15	-2,96967616506033e-15	-2,85400727449418e-15	-2,72704066565313e-15	-2,58849448110245e-15	-2,43808470111323e-15	-2,27552513766938e-15	-2,10052742847489e-15	-1,91280103096050e-15	-1,71205321629102e-15	-1,49798906337230e-15	-1,27031145285821e-15	-1,02872106115791e-15	-7,72916354442495e-16	-5,02593582653857e-16	-2,17446773505851e-16	8,28322734994003e-17	3,98553993073018e-16	7,30031060126885e-16	1,07757839576839e-15	1,44151317329451e-15	1,82215482418298e-15	2,21982504408605e-15	2,63484779882380e-15	3,06754933037626e-15	3,51825816287691e-15	3,98730510860564e-15	4,47502327398127e-15	4,98174806555524e-15	5,50781719600390e-15	6,05357069012137e-15	6,61935089081403e-15	7,20550246509087e-15	7,81237241005853e-15"
                , new DefaultMatrixFormatProvider(CultureInfo.CreateSpecificCulture("fr-FR")));

            Assert.IsTrue(jagged.IsEqual(expected, rtol: 1e-2));
        }
Example #25
0
        // Evaluate t-SNE cost function (exactly)
        internal static double evaluateError(double[][] P, double[][] Y, int N, int D)
        {
            // Compute the squared Euclidean distance matrix
            double[][] DD = Jagged.Zeros(N, N);
            double[][] Q  = Jagged.Zeros(N, N);
            computeSquaredEuclideanDistance(Y, N, D, DD);

            // Compute Q-matrix and normalization sum
            double sum_Q = DBL_MIN;

            for (int n = 0; n < N; n++)
            {
                for (int m = 0; m < N; m++)
                {
                    if (n != m)
                    {
                        Q[n][m] = 1.0 / (1.0 + DD[n][m]);
                        sum_Q  += Q[n][m];
                    }
                    else
                    {
                        Q[n][m] = DBL_MIN;
                    }
                }
            }

            Q.Divide(sum_Q, result: Q);

            // Sum t-SNE error
            double C = 0.0;

            for (int n = 0; n < P.Length; n++)
            {
                for (int j = 0; j < P[n].Length; j++)
                {
                    C += P[n][j] * System.Math.Log((P[n][j] + FLT_MIN) / (Q[n][j] + FLT_MIN));
                }
            }

            return(C);
        }
        public void FitTest()
        {
            double[] original     = { 5, 5, 1, 4, 1, 2, 2, 3, 3, 3, 4, 3, 3, 3, 4, 3, 2, 3 };
            var      distribution = new MultivariateEmpiricalDistribution(original.ToJagged());

            int[]      weights = { 2, 1, 1, 1, 2, 3, 1, 3, 1, 1, 1, 1 };
            double[]   sources = { 5, 1, 4, 1, 2, 3, 4, 3, 4, 3, 2, 3 };
            double[][] samples = sources.ToJagged();
            var        target  = new MultivariateEmpiricalDistribution(Jagged.Zeros(1, 1));

            target.Fit(samples, weights);

            Assert.AreEqual(distribution.Mean[0], target.Mean[0]);
            Assert.AreEqual(distribution.Median[0], target.Median[0]);
            Assert.AreEqual(distribution.Mode[0], target.Mode[0]);
            Assert.AreEqual(distribution.Smoothing[0, 0], target.Smoothing[0, 0]);
            Assert.AreEqual(distribution.Variance[0], target.Variance[0]);
            Assert.IsTrue(target.Weights.IsEqual(weights.Divide(weights.Sum())));
            Assert.AreEqual(target.Samples, samples);

            for (double x = 0; x < 6; x += 0.1)
            {
                double actual, expected;
                expected = distribution.ComplementaryDistributionFunction(x);
                actual   = target.ComplementaryDistributionFunction(x);
                Assert.AreEqual(expected, actual);

                expected = distribution.DistributionFunction(x);
                actual   = target.DistributionFunction(x);
                Assert.AreEqual(expected, actual);

                expected = distribution.LogProbabilityDensityFunction(x);
                actual   = target.LogProbabilityDensityFunction(x);
                Assert.AreEqual(expected, actual, 1e-15);

                expected = distribution.ProbabilityDensityFunction(x);
                actual   = target.ProbabilityDensityFunction(x);
                Assert.AreEqual(expected, actual, 1e-15);
            }
        }
        /// <summary>
        ///   Converts an image from one representation to another. When
        ///   converting to byte, the <see cref="Max"/> and <see cref="Min"/>
        ///   are ignored.
        /// </summary>
        ///
        /// <param name="input">The input image to be converted.</param>
        /// <param name="output">The converted image.</param>
        ///
        public void Convert(UnmanagedImage input, out byte[][] output)
        {
            int width     = input.Width;
            int height    = input.Height;
            int pixelSize = input.PixelSize;
            int offset    = input.Offset;

            output = Jagged.Zeros <byte>(height, width);

            unsafe
            {
                byte *src = (byte *)input.ImageData.ToPointer() + Channel;

                for (int y = 0; y < height; y++)
                {
                    for (int x = 0; x < width; x++, src += pixelSize)
                    {
                        output[y][x] = *src;
                    }
                    src += offset;
                }
            }
        }
Example #28
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));
        }
Example #29
0
        /// <summary>
        ///   Projects vectors from a sequence of vectors into
        ///   a hypersphere, augmenting their size in one unit
        ///   and normalizing them to be unit vectors.
        /// </summary>
        ///
        /// <param name="input">A sequence of vectors.</param>
        ///
        /// <returns>A sequence of vector projections.</returns>
        ///
        private double[][] snorm(double[][] input)
        {
            // Create the augmented sequence projection
            double[][] projection = Jagged.Zeros(input.Length, input[0].Length + 1);

            for (int i = 0; i < input.Length; i++)
            {
                double norm = alpha * alpha;

                for (int j = 0; j < input[i].Length; j++)
                {
                    norm += input[i][j] * input[i][j];
                }
                norm = Math.Sqrt(norm);

                for (int j = 0; j < input[i].Length; j++)
                {
                    projection[i][j] = input[i][j] / norm;
                }
                projection[i][input[i].Length] = alpha / norm;
            }

            return(projection); // return the projected sequence
        }
        private void init(double[][] inputs, int[] outputs, IDistance <double[]> distance)
        {
            this.distance = distance;

            means = Jagged.Zeros(NumberOfOutputs, NumberOfInputs);

            int[] counts = new int[NumberOfOutputs];

            // Compute the average of the input vectors for each of
            // the output classes. Afterwards, a decision can be cast
            // by checking to which average a new sample is closer.
            for (int i = 0; i < inputs.Length; i++)
            {
                int      k    = outputs[i];
                double[] mean = means[k];
                for (int j = 0; j < mean.Length; j++)
                {
                    mean[j] += inputs[i][j];
                }
                counts[k]++;
            }

            means.Divide(counts, dimension: 0, result: means);
        }