Beispiel #1
0
        static ListDataSource InitListDataSource()
        {
            var dataSource = new ListDataSource();

            dataSource.InputDimensions  = 2;
            dataSource.OutputDimensions = 2;

            double[] omega1 = { 1.0, 0.0 };
            double[] omega2 = { 0.0, 1.0 };

            var normal = new Normal();

            Random rnd = new Random();

            for (int i = 0; i < 1000; i++)
            {
                var selectedOmega = rnd.Next(0, 2);

                if (selectedOmega == 0)
                {
                    AddDataPoint(dataSource, omega1, new double[] { normal.Sample() + 10, normal.Sample() + 5.0 });
                }
                else if (selectedOmega == 1)
                {
                    AddDataPoint(dataSource, omega2, new double[] { normal.Sample(), normal.Sample() });
                }
            }

            return(dataSource);
        }
Beispiel #2
0
 static void AddDataPoint(ListDataSource dataSource, double[] label, double[] value)
 {
     dataSource.DataPointList.Add(new DataPoint
     {
         Label = label,
         Value = value
     });
 }
Beispiel #3
0
        static ListDataSource InitSingleValueDataSource()
        {
            var dataSource = new ListDataSource();

            dataSource.InputDimensions  = 2;
            dataSource.OutputDimensions = 2;

            AddDataPoint(dataSource, new double[] { 0.01, 0.99 }, new double[] { 0.05, 0.10 });

            return(dataSource);
        }