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); }
public void RemoveChildWindow(IDataWindow win) { if (_windows.Contains(win)) { _windows.Remove(win); win.Parent = null; } }
public void updateParentsIfNecessary() { IDataWindow window = this; while (!window.Parent.Valid) { window = window.Parent; } window.Update(); }
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); } }
/// <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 }
/* * IBranchDataWindow Methods */ public void AddChildWindow(IDataWindow win) { _windows.Add(win); win.Parent = this; }
/// <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]); }
protected SubDataWindow(IDataWindow parent, int offset) { Parent = parent; Offset = offset; }
public AddingPatientAssistant(IDataWindow dataWindow) { InitializeComponent(); this._dataWindow = dataWindow; }
public void SetWindowMode(WindowMode windowMode) { window = WindowFactory.CreateWindow(windowMode); Repaint(); }
public StudentCore(IDataWindow <PagerSetting> dataWindow, TableSetting <PagerSetting>[] tableSettings) : base(dataWindow, tableSettings) { }