public bool Initialize() { // Network param int cellsPerColumn; int minimumOverlap; int desiredLocalActiviy; int segmentActivationThreshold; int minSegmentActivityForLearning; double proximalSegmentCoverage; try { _regionWidth = int.Parse(regionWidthTextBox.Text); _regionHeight = int.Parse(regionHeightTextBox.Text); cellsPerColumn = int.Parse(networkSizeComboBox.Text.Substring(networkSizeComboBox.Text.Length - 1, 1)); minimumOverlap = int.Parse(minimumOverlapTextBox.Text); desiredLocalActiviy = int.Parse(desiredLocalActivityTextBox.Text); segmentActivationThreshold = int.Parse(segmentActivationThresholdTextBox.Text); minSegmentActivityForLearning = int.Parse(segmentActivationThresholdTextBox.Text); proximalSegmentCoverage = double.Parse(proximalSegmentCoverageTextBox.Text) / 100; } catch (Exception exch) { _director.Log(exch.ToString()); return(false); } if (proximalSegmentCoverage < 0 && proximalSegmentCoverage > 1) { _director.Log("Proximal segment coverage out of range."); return(false); } // Create the network. _regionAgent = new HTMRegionAgent(_director, _regionWidth, _regionHeight, cellsPerColumn, minimumOverlap, desiredLocalActiviy, segmentActivationThreshold, minSegmentActivityForLearning, proximalSegmentCoverage); _regionAgent.InputAgent = _inputAgent; _regionAgent.Initialize(); // Create the viewer _regionViewer = new HTMRegionViewer(_regionAgent); _regionViewer.MdiParent = this.MdiParent; _regionViewer.Location = new Point(this.Left + this.Width, 20); _regionViewer.Show(); _isInitialized = true; structureGroupBox.Enabled = false; // disable the structural parameters return(true); }
public bool Initialize() { // Network param int cellsPerColumn; int minimumOverlap; int desiredLocalActiviy; int segmentActivationThreshold; int minSegmentActivityForLearning; double proximalSegmentCoverage; try { _regionWidth = int.Parse(regionWidthTextBox.Text); _regionHeight = int.Parse(regionHeightTextBox.Text); cellsPerColumn = int.Parse(networkSizeComboBox.Text.Substring(networkSizeComboBox.Text.Length - 1, 1)); minimumOverlap = int.Parse(minimumOverlapTextBox.Text); desiredLocalActiviy = int.Parse(desiredLocalActivityTextBox.Text); segmentActivationThreshold = int.Parse(segmentActivationThresholdTextBox.Text); minSegmentActivityForLearning = int.Parse(segmentActivationThresholdTextBox.Text); proximalSegmentCoverage = double.Parse(proximalSegmentCoverageTextBox.Text) / 100; } catch (Exception exch) { _director.Log(exch.ToString()); return false; } if (proximalSegmentCoverage < 0 && proximalSegmentCoverage > 1) { _director.Log("Proximal segment coverage out of range."); return false; } // Create the network. _regionAgent = new HTMRegionAgent(_director, _regionWidth, _regionHeight, cellsPerColumn, minimumOverlap, desiredLocalActiviy, segmentActivationThreshold, minSegmentActivityForLearning, proximalSegmentCoverage); _regionAgent.InputAgent = _inputAgent; _regionAgent.Initialize(); // Create the viewer _regionViewer = new HTMRegionViewer(_regionAgent); _regionViewer.MdiParent = this.MdiParent; _regionViewer.Location = new Point(this.Left + this.Width, 20); _regionViewer.Show(); _isInitialized = true; structureGroupBox.Enabled = false; // disable the structural parameters return true; }