Ejemplo n.º 1
0
        private static IDataWindow[] TranslateToDataWindows(IEnumerable <CurrencyData> data, int windowSize)
        {
            var enumeratedData = data.ToList();
            var sizeOfOutput   = enumeratedData.Count() / windowSize;
            var output         = new IDataWindow[sizeOfOutput];

            for (var index = 0; index < sizeOfOutput; index++)
            {
                var window     = new DataWindow();
                var inputLayer = enumeratedData
                                 .Skip(windowSize * index)
                                 .Take(windowSize).Select(x => x.Close)
                                 .ToArray();

                var outputLayer = enumeratedData
                                  .Skip(windowSize * index)
                                  .Skip(windowSize).Take(1)
                                  .Select(d => d.Close)
                                  .Select(x => x > inputLayer[^ 1] ? 1.0F : 0.0F)
                                  .ToArray();

                outputLayer = new[] { outputLayer[0], outputLayer[0] == 0F ? 1F : 0F };

                window.InputLayer  = inputLayer;
                window.OutputLayer = outputLayer;
                output[index]      = window;
            }

            return(output);
        }
Ejemplo n.º 2
0
 public void RemoveChildWindow(IDataWindow win)
 {
     if (_windows.Contains(win))
     {
         _windows.Remove(win);
         win.Parent = null;
     }
 }
Ejemplo n.º 3
0
        public void updateParentsIfNecessary()
        {
            IDataWindow window = this;

            while (!window.Parent.Valid)
            {
                window = window.Parent;
            }

            window.Update();
        }
Ejemplo n.º 4
0
        protected void changeIndexWindow(IDataWindow dwin)
        {
            if (dwin.Parent is IndexedDataWindow)
            {
                IndexedDataWindow iwin = (IndexedDataWindow)dwin.Parent;

                if (iwin.ListGroup == _listGroup)
                {
                    dwin.Parent.RemoveChildWindow(dwin);
                    _indexWindow.AddChildWindow(dwin);
                }
            }
            else
            {
                changeIndexWindow(dwin.Parent);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Creates an array with dimensions equal to that of the neural network with
        /// pre filled dimensions
        /// </summary>
        /// <param name="data">The data to be used to pre fill the input dimension</param>
        /// <returns>an array the same size as the neural network with pre-filled dimensions</returns>
        private void CreateActivationArray(IDataWindow data)
        {
            var firstDimensionSize  = Options.LayerStructure.Length;
            var secondDimensionSize = Options.MaxLayerDensity;

            _exampleActivations = new float[firstDimensionSize, secondDimensionSize];

            if (data == null || !VerifyDataWindowValidity(data))
            {
                throw new InvalidDataWindowException(nameof(CreateActivationArray));
            }

            for (var i = 0; i < data.InputLayer.Length; i++)
            {
                _exampleActivations[0, i] = data.InputLayer[i];
            }
            //create array by dimensions
            //if data != null
            //  fill first layer
        }
Ejemplo n.º 6
0
        /*
         * IBranchDataWindow Methods
         */

        public void AddChildWindow(IDataWindow win)
        {
            _windows.Add(win);
            win.Parent = this;
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Validates a DataWindows structure against the structure specified in options
 /// </summary>
 /// <param name="dataWindow">The data window to validate</param>
 /// <returns>Is valid</returns>
 public bool VerifyDataWindowValidity(IDataWindow dataWindow)
 {
     return(dataWindow.InputLayer.Length == Options.LayerStructure[0] &&
            dataWindow.OutputLayer.Length == Options.LayerStructure[^ 1]);
 }
Ejemplo n.º 8
0
 protected SubDataWindow(IDataWindow parent, int offset)
 {
     Parent = parent;
     Offset = offset;
 }
 public AddingPatientAssistant(IDataWindow dataWindow)
 {
     InitializeComponent();
     this._dataWindow = dataWindow;
 }
Ejemplo n.º 10
0
 public void SetWindowMode(WindowMode windowMode)
 {
     window = WindowFactory.CreateWindow(windowMode);
     Repaint();
 }
Ejemplo n.º 11
0
 public StudentCore(IDataWindow <PagerSetting> dataWindow, TableSetting <PagerSetting>[] tableSettings)
     : base(dataWindow, tableSettings)
 {
 }