Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1112 for trunk


Ignore:
Timestamp:
01/12/09 15:45:21 (16 years ago)
Author:
abeham
Message:

Updated ES to automatically calculate LearningRate parameters based on the problem dimension (ticket #84)

Location:
trunk/sources/HeuristicLab.ES
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ES/ESEditor.Designer.cs

    r1091 r1112  
    8080      this.problemInitializationTextBox = new System.Windows.Forms.TextBox();
    8181      this.setRandomSeedRandomlyCheckBox = new System.Windows.Forms.CheckBox();
     82      this.problemDimensionTextBox = new System.Windows.Forms.TextBox();
    8283      this.initialMutationStrengthVectorTextBox = new System.Windows.Forms.TextBox();
    8384      this.evaluationLabel = new System.Windows.Forms.Label();
     
    8586      this.solutionGenerationLabel = new System.Windows.Forms.Label();
    8687      this.problemInitializationLabel = new System.Windows.Forms.Label();
     88      this.problemDimensionLabel = new System.Windows.Forms.Label();
    8789      this.initialMutationStrengthLabel = new System.Windows.Forms.Label();
    8890      this.mutationRateLabel = new System.Windows.Forms.Label();
     
    106108      this.cloneEngineButton = new System.Windows.Forms.Button();
    107109      this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    108       this.problemDimensionLabel = new System.Windows.Forms.Label();
    109       this.problemDimensionTextBox = new System.Windows.Forms.TextBox();
    110110      this.tabControl.SuspendLayout();
    111111      this.parametersTabPage.SuspendLayout();
     
    215215      this.learningRateTextBox.Size = new System.Drawing.Size(186, 20);
    216216      this.learningRateTextBox.TabIndex = 17;
     217      this.toolTip.SetToolTip(this.learningRateTextBox, @"Automatically updates when Problem Dimension (dim) is changed.
     218The used formula is: tau = 1 / Sqrt(2*Sqrt(dim))");
    217219      //
    218220      // label1
     
    233235      this.generalLearningRateTextBox.Size = new System.Drawing.Size(186, 20);
    234236      this.generalLearningRateTextBox.TabIndex = 15;
     237      this.toolTip.SetToolTip(this.generalLearningRateTextBox, @"Automatically updates when Problem Dimension (dim) is changed.
     238The used formula is: tau0 = 1 / Sqrt(2*dim)");
    235239      //
    236240      // targetSuccessRateLabel
     
    494498      this.setRandomSeedRandomlyCheckBox.UseVisualStyleBackColor = true;
    495499      //
     500      // problemDimensionTextBox
     501      //
     502      this.problemDimensionTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
     503      this.problemDimensionTextBox.Location = new System.Drawing.Point(168, 172);
     504      this.problemDimensionTextBox.Name = "problemDimensionTextBox";
     505      this.problemDimensionTextBox.Size = new System.Drawing.Size(186, 20);
     506      this.problemDimensionTextBox.TabIndex = 13;
     507      this.problemDimensionTextBox.Validated += new System.EventHandler(this.problemDimensionTextBox_Validated);
     508      //
    496509      // initialMutationStrengthVectorTextBox
    497510      //
     
    543556      this.problemInitializationLabel.TabIndex = 19;
    544557      this.problemInitializationLabel.Text = "&Problem Initialization:";
     558      //
     559      // problemDimensionLabel
     560      //
     561      this.problemDimensionLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
     562      this.problemDimensionLabel.AutoSize = true;
     563      this.problemDimensionLabel.Location = new System.Drawing.Point(7, 175);
     564      this.problemDimensionLabel.Name = "problemDimensionLabel";
     565      this.problemDimensionLabel.Size = new System.Drawing.Size(100, 13);
     566      this.problemDimensionLabel.TabIndex = 12;
     567      this.problemDimensionLabel.Text = "Problem Dimension:";
    545568      //
    546569      // initialMutationStrengthLabel
     
    694717      this.scopesTabPage.Name = "scopesTabPage";
    695718      this.scopesTabPage.Padding = new System.Windows.Forms.Padding(3);
    696       this.scopesTabPage.Size = new System.Drawing.Size(493, 461);
     719      this.scopesTabPage.Size = new System.Drawing.Size(493, 495);
    697720      this.scopesTabPage.TabIndex = 2;
    698721      this.scopesTabPage.Text = "Scopes";
     
    706729      this.scopeView.Name = "scopeView";
    707730      this.scopeView.Scope = null;
    708       this.scopeView.Size = new System.Drawing.Size(487, 455);
     731      this.scopeView.Size = new System.Drawing.Size(487, 489);
    709732      this.scopeView.TabIndex = 0;
    710733      //
     
    749772      this.toolTip.InitialDelay = 200;
    750773      this.toolTip.ReshowDelay = 40;
    751       //
    752       // problemDimensionLabel
    753       //
    754       this.problemDimensionLabel.Anchor = System.Windows.Forms.AnchorStyles.None;
    755       this.problemDimensionLabel.AutoSize = true;
    756       this.problemDimensionLabel.Location = new System.Drawing.Point(7, 175);
    757       this.problemDimensionLabel.Name = "problemDimensionLabel";
    758       this.problemDimensionLabel.Size = new System.Drawing.Size(100, 13);
    759       this.problemDimensionLabel.TabIndex = 12;
    760       this.problemDimensionLabel.Text = "Problem Dimension:";
    761       //
    762       // problemDimensionTextBox
    763       //
    764       this.problemDimensionTextBox.Anchor = System.Windows.Forms.AnchorStyles.None;
    765       this.problemDimensionTextBox.Location = new System.Drawing.Point(168, 172);
    766       this.problemDimensionTextBox.Name = "problemDimensionTextBox";
    767       this.problemDimensionTextBox.Size = new System.Drawing.Size(186, 20);
    768       this.problemDimensionTextBox.TabIndex = 13;
    769       this.problemDimensionTextBox.Validated += new System.EventHandler(this.problemDimensionTextBox_Validated);
    770774      //
    771775      // ESEditor
  • trunk/sources/HeuristicLab.ES/ESEditor.cs

    r1091 r1112  
    6161      : this() {
    6262      ES = es;
     63      int dimension = es.ShakingFactors.Length;
     64      problemDimensionTextBox.Text = dimension.ToString();
    6365    }
    6466
     
    268270      if (ES.ShakingFactors.Length != dim) {
    269271        problemDimensionTextBox.Text = ES.ShakingFactors.Length.ToString();
     272        UpdateLearningRates();
    270273      }
    271274      Refresh();
     
    287290        }
    288291        ES.ShakingFactors = shakingFactors;
     292        UpdateLearningRates();
    289293        Refresh();
     294      }
     295    }
     296
     297    private void UpdateLearningRates() {
     298      if (ES != null) {
     299        int dimension = int.Parse(problemDimensionTextBox.Text);
     300        ES.GeneralLearningRate = 1 / Math.Sqrt(2 * dimension);
     301        ES.LearningRate = 1 / Math.Sqrt(2 * Math.Sqrt(dimension));
    290302      }
    291303    }
  • trunk/sources/HeuristicLab.ES/ESEditor.resx

    r1091 r1112  
    121121    <value>7, 3</value>
    122122  </metadata>
     123  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     124    <value>7, 3</value>
     125  </metadata>
    123126  <data name="initialMutationStrengthVectorTextBox.ToolTip" xml:space="preserve">
    124127    <value>Enter a pattern that is used to generate the initial strategy vector.
Note: See TracChangeset for help on using the changeset viewer.