Пример #1
0
        public DataExtremumsForNetwork Clone()
        {
            var extremums = new DataExtremumsForNetwork();

            for (int i = 0; i < InputExtremums.Count; i++)
            {
                extremums.InputExtremums.Add(InputExtremums[i].Clone());
            }

            for (int i = 0; i < OutputExtremums.Count; i++)
            {
                extremums.OutputExtremums.Add(OutputExtremums[i].Clone());
            }

            return(extremums);
        }
Пример #2
0
        public static DataExtremumsForNetwork Merge(DataExtremumsForNetwork x, DataExtremumsForNetwork y)
        {
            var ret = new DataExtremumsForNetwork();

            for (int i = 0; i < x.InputExtremums.Count; i++)
            {
                ret.InputExtremums.Add(DataExtremum.Merge(x.InputExtremums[i], y.InputExtremums[i]));
            }

            for (int i = 0; i < x.OutputExtremums.Count; i++)
            {
                ret.OutputExtremums.Add(DataExtremum.Merge(x.OutputExtremums[i], y.OutputExtremums[i]));
            }

            return(ret);
        }
Пример #3
0
        public void Normalize(double minTo, double maxTo, DataExtremumsForNetwork extremumus = null)
        {
            if (extremumus == null)
            {
                extremumus = Extremums;
            }

            var n = patterns.First().Input.Count;

            for (int i = 0; i < n; i++)
            {
                Extremums.InputExtremums[i].Normalizor = new Normalizor(
                    extremumus.InputExtremums[i].MinValue,
                    extremumus.InputExtremums[i].MaxValue,
                    minTo,
                    maxTo);
            }

            n = patterns.First().IdealOutput.Count;
            for (int i = 0; i < n; i++)
            {
                Extremums.OutputExtremums[i].Normalizor = new Normalizor(
                    extremumus.OutputExtremums[i].MinValue,
                    extremumus.OutputExtremums[i].MaxValue,
                    minTo,
                    maxTo);
            }

            foreach (Pattern p in patterns)
            {
                for (int i = 0; i < p.Input.Count; i++)
                {
                    p.Input[i] = Extremums.InputExtremums[i].Normalizor.Normalize(p.Input[i]);
                }

                for (int i = 0; i < p.IdealOutput.Count; i++)
                {
                    p.IdealOutput[i] = Extremums.OutputExtremums[i].Normalizor.Normalize(p.IdealOutput[i]);
                }
            }
        }
Пример #4
0
        protected int startTime; // starting time index. Needed for continuity between train and test sets

        public DataSet(int startTime)
        {
            Extremums = new DataExtremumsForNetwork();

            this.startTime = startTime;
        }