Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/17 10:54:13 (8 years ago)
Author:
gkronber
Message:

#2650 added a way to set the probability of variable changes via the GUI

Location:
branches/symbreg-factors-2650
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/LaggedVariableView.Designer.cs

    r14185 r14759  
    6363      // weightInitializationMuTextBox
    6464      //
     65      this.weightInitializationMuTextBox.Size = new System.Drawing.Size(293, 20);
    6566      this.toolTip.SetToolTip(this.weightInitializationMuTextBox, "The mu (mean) parameter of the normal distribution from which to sample the initi" +
    6667        "al weights.");
     
    6970      //
    7071      this.initializationGroupBox.Location = new System.Drawing.Point(6, 7);
    71       this.initializationGroupBox.Size = new System.Drawing.Size(379, 73);
     72      this.initializationGroupBox.Size = new System.Drawing.Size(391, 73);
    7273      //
    7374      // weightSigmaLabel
     
    7778      // weightInitializationSigmaTextBox
    7879      //
     80      this.weightInitializationSigmaTextBox.Size = new System.Drawing.Size(293, 20);
    7981      this.toolTip.SetToolTip(this.weightInitializationSigmaTextBox, "The sigma parameter for the normal distribution from which to sample the initial " +
    8082        "weights.");
     
    8385      //
    8486      this.mutationGroupBox.Location = new System.Drawing.Point(6, 86);
    85       this.mutationGroupBox.Size = new System.Drawing.Size(379, 73);
     87      this.mutationGroupBox.Size = new System.Drawing.Size(391, 95);
    8688      //
    8789      // multiplicativeWeightChangeLabel
    8890      //
     91      this.multiplicativeWeightChangeLabel.TabIndex = 4;
    8992      this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
    9093        " change in weight.");
     
    9295      // multiplicativeWeightChangeSigmaTextBox
    9396      //
     97      this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5;
    9498      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
    9599        "tive change in weight.");
     
    97101      // additiveWeightChangeLabel
    98102      //
     103      this.additiveWeightChangeLabel.TabIndex = 2;
    99104      this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    100105        "change in weight.");
     
    102107      // additiveWeightChangeSigmaTextBox
    103108      //
     109      this.additiveWeightChangeSigmaTextBox.TabIndex = 3;
    104110      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    105111        "change in weight.");
     
    111117      // parametersTabPage
    112118      //
    113       this.parametersTabPage.Size = new System.Drawing.Size(400, 149);
     119      this.parametersTabPage.Size = new System.Drawing.Size(412, 208);
    114120      //
    115121      // tabControl
    116122      //
    117123      this.tabControl.Location = new System.Drawing.Point(0, 179);
    118       this.tabControl.Size = new System.Drawing.Size(408, 175);
    119       this.tabControl.TabIndex = 9;
     124      this.tabControl.Size = new System.Drawing.Size(420, 234);
     125      this.tabControl.TabIndex = 13;
     126      //
     127      // varChangeProbTextBox
     128      //
     129      this.varChangeProbTextBox.TabIndex = 1;
     130      this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
     131        "change in weight.");
     132      //
     133      // varChangeProbLabel
     134      //
     135      this.varChangeProbLabel.TabIndex = 0;
     136      this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" +
     137        "s are sampled uniformly.");
    120138      //
    121139      // initialFrequencyLabel
    122140      //
     141      this.initialFrequencyLabel.TabIndex = 2;
    123142      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
    124143      //
     
    126145      //
    127146      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
     147      this.initialFrequencyTextBox.Size = new System.Drawing.Size(323, 20);
     148      this.initialFrequencyTextBox.TabIndex = 3;
     149      //
     150      // enabledCheckBox
     151      //
     152      this.enabledCheckBox.TabIndex = 8;
     153      //
     154      // minimumArityLabel
     155      //
     156      this.minimumArityLabel.TabIndex = 4;
     157      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
     158      //
     159      // maximumArityLabel
     160      //
     161      this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol");
    128162      //
    129163      // minimumArityTextBox
    130164      //
    131165      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    132       this.minimumArityTextBox.Size = new System.Drawing.Size(315, 20);
     166      this.minimumArityTextBox.Size = new System.Drawing.Size(327, 20);
     167      this.minimumArityTextBox.TabIndex = 5;
    133168      //
    134169      // maximumArityTextBox
    135170      //
    136171      this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    137       this.maximumArityTextBox.Size = new System.Drawing.Size(315, 20);
     172      this.maximumArityTextBox.Size = new System.Drawing.Size(327, 20);
    138173      //
    139174      // nameTextBox
     
    141176      this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    142177      this.errorProvider.SetIconPadding(this.nameTextBox, 2);
     178      this.nameTextBox.Size = new System.Drawing.Size(302, 20);
     179      //
     180      // infoLabel
     181      //
     182      this.infoLabel.Location = new System.Drawing.Point(401, 3);
    143183      //
    144184      // minTimeOffsetLabel
     
    148188      this.minTimeOffsetLabel.Name = "minTimeOffsetLabel";
    149189      this.minTimeOffsetLabel.Size = new System.Drawing.Size(81, 13);
    150       this.minTimeOffsetLabel.TabIndex = 5;
     190      this.minTimeOffsetLabel.TabIndex = 9;
    151191      this.minTimeOffsetLabel.Text = "Min. time offset:";
    152192      //
     
    157197      this.maxTimeOffsetLabel.Name = "maxTimeOffsetLabel";
    158198      this.maxTimeOffsetLabel.Size = new System.Drawing.Size(84, 13);
    159       this.maxTimeOffsetLabel.TabIndex = 7;
     199      this.maxTimeOffsetLabel.TabIndex = 11;
    160200      this.maxTimeOffsetLabel.Text = "Max. time offset:";
    161201      //
    162202      // minTimeOffsetTextBox
    163203      //
    164       this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     204      this.minTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    165205            | System.Windows.Forms.AnchorStyles.Right)));
    166206      this.minTimeOffsetTextBox.Location = new System.Drawing.Point(93, 127);
    167207      this.minTimeOffsetTextBox.Name = "minTimeOffsetTextBox";
    168       this.minTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
    169       this.minTimeOffsetTextBox.TabIndex = 6;
     208      this.minTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20);
     209      this.minTimeOffsetTextBox.TabIndex = 10;
    170210      this.minTimeOffsetTextBox.TextChanged += new System.EventHandler(this.minTimeOffsetTextBox_TextChanged);
    171211      //
    172212      // maxTimeOffsetTextBox
    173213      //
    174       this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     214      this.maxTimeOffsetTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
    175215            | System.Windows.Forms.AnchorStyles.Right)));
    176216      this.maxTimeOffsetTextBox.Location = new System.Drawing.Point(93, 153);
    177217      this.maxTimeOffsetTextBox.Name = "maxTimeOffsetTextBox";
    178       this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(315, 20);
    179       this.maxTimeOffsetTextBox.TabIndex = 8;
     218      this.maxTimeOffsetTextBox.Size = new System.Drawing.Size(327, 20);
     219      this.maxTimeOffsetTextBox.TabIndex = 12;
    180220      this.maxTimeOffsetTextBox.TextChanged += new System.EventHandler(this.maxTimeOffsetTextBox_TextChanged);
    181221      //
    182222      // LaggedVariableView
    183223      //
    184       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    185224      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    186225      this.Controls.Add(this.minTimeOffsetTextBox);
     
    189228      this.Controls.Add(this.maxTimeOffsetTextBox);
    190229      this.Name = "LaggedVariableView";
    191       this.Size = new System.Drawing.Size(408, 352);
     230      this.Size = new System.Drawing.Size(420, 411);
     231      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
    192232      this.Controls.SetChildIndex(this.maxTimeOffsetTextBox, 0);
    193233      this.Controls.SetChildIndex(this.minTimeOffsetLabel, 0);
  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.Designer.cs

    r14185 r14759  
    5151      this.weightInitializationSigmaTextBox = new System.Windows.Forms.TextBox();
    5252      this.mutationGroupBox = new System.Windows.Forms.GroupBox();
     53      this.varChangeProbTextBox = new System.Windows.Forms.TextBox();
     54      this.varChangeProbLabel = new System.Windows.Forms.Label();
    5355      this.multiplicativeWeightChangeLabel = new System.Windows.Forms.Label();
    5456      this.multiplicativeWeightChangeSigmaTextBox = new System.Windows.Forms.TextBox();
     
    6769      // initialFrequencyLabel
    6870      //
     71      this.initialFrequencyLabel.TabIndex = 2;
    6972      this.toolTip.SetToolTip(this.initialFrequencyLabel, "Relative frequency of the symbol in randomly created trees");
    7073      //
     
    7376      this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    7477      this.initialFrequencyTextBox.Size = new System.Drawing.Size(311, 20);
     78      this.initialFrequencyTextBox.TabIndex = 3;
     79      //
     80      // enabledCheckBox
     81      //
     82      this.enabledCheckBox.TabIndex = 8;
    7583      //
    7684      // minimumArityLabel
    7785      //
     86      this.minimumArityLabel.TabIndex = 4;
    7887      this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol");
    7988      //
     
    8695      this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    8796      this.minimumArityTextBox.Size = new System.Drawing.Size(311, 20);
     97      this.minimumArityTextBox.TabIndex = 5;
    8898      //
    8999      // maximumArityTextBox
     
    165175      this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    166176            | System.Windows.Forms.AnchorStyles.Right)));
     177      this.mutationGroupBox.Controls.Add(this.varChangeProbTextBox);
     178      this.mutationGroupBox.Controls.Add(this.varChangeProbLabel);
    167179      this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeLabel);
    168180      this.mutationGroupBox.Controls.Add(this.multiplicativeWeightChangeSigmaTextBox);
     
    171183      this.mutationGroupBox.Location = new System.Drawing.Point(6, 85);
    172184      this.mutationGroupBox.Name = "mutationGroupBox";
    173       this.mutationGroupBox.Size = new System.Drawing.Size(391, 73);
     185      this.mutationGroupBox.Size = new System.Drawing.Size(391, 97);
    174186      this.mutationGroupBox.TabIndex = 1;
    175187      this.mutationGroupBox.TabStop = false;
    176188      this.mutationGroupBox.Text = "Mutation";
    177189      //
     190      // varChangeProbTextBox
     191      //
     192      this.varChangeProbTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     193            | System.Windows.Forms.AnchorStyles.Right)));
     194      this.varChangeProbTextBox.Location = new System.Drawing.Point(201, 13);
     195      this.varChangeProbTextBox.Name = "varChangeProbTextBox";
     196      this.varChangeProbTextBox.Size = new System.Drawing.Size(184, 20);
     197      this.varChangeProbTextBox.TabIndex = 1;
     198      this.toolTip.SetToolTip(this.varChangeProbTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
     199        "change in weight.");
     200      this.varChangeProbTextBox.TextChanged += new System.EventHandler(this.VarProbTextBox_TextChanged);
     201      //
     202      // varChangeProbLabel
     203      //
     204      this.varChangeProbLabel.AutoSize = true;
     205      this.varChangeProbLabel.Location = new System.Drawing.Point(6, 16);
     206      this.varChangeProbLabel.Name = "varChangeProbLabel";
     207      this.varChangeProbLabel.Size = new System.Drawing.Size(134, 13);
     208      this.varChangeProbLabel.TabIndex = 0;
     209      this.varChangeProbLabel.Text = "Variable change probability";
     210      this.toolTip.SetToolTip(this.varChangeProbLabel, "The probability of changing the referenced variable in [0..1]. Variable reference" +
     211        "s are sampled uniformly.");
     212      //
    178213      // multiplicativeWeightChangeLabel
    179214      //
    180215      this.multiplicativeWeightChangeLabel.AutoSize = true;
    181       this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 48);
     216      this.multiplicativeWeightChangeLabel.Location = new System.Drawing.Point(6, 68);
    182217      this.multiplicativeWeightChangeLabel.Name = "multiplicativeWeightChangeLabel";
    183218      this.multiplicativeWeightChangeLabel.Size = new System.Drawing.Size(180, 13);
    184       this.multiplicativeWeightChangeLabel.TabIndex = 2;
     219      this.multiplicativeWeightChangeLabel.TabIndex = 4;
    185220      this.multiplicativeWeightChangeLabel.Text = "Multiplicative weight change (sigma):";
    186221      this.toolTip.SetToolTip(this.multiplicativeWeightChangeLabel, "The sigma parameter for the normal distribution to use to sample a multiplicative" +
     
    191226      this.multiplicativeWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    192227            | System.Windows.Forms.AnchorStyles.Right)));
    193       this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 45);
     228      this.multiplicativeWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 65);
    194229      this.multiplicativeWeightChangeSigmaTextBox.Name = "multiplicativeWeightChangeSigmaTextBox";
    195230      this.multiplicativeWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20);
    196       this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 3;
     231      this.multiplicativeWeightChangeSigmaTextBox.TabIndex = 5;
    197232      this.toolTip.SetToolTip(this.multiplicativeWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample a multiplica" +
    198233        "tive change in weight.");
     
    202237      //
    203238      this.additiveWeightChangeLabel.AutoSize = true;
    204       this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 22);
     239      this.additiveWeightChangeLabel.Location = new System.Drawing.Point(6, 42);
    205240      this.additiveWeightChangeLabel.Name = "additiveWeightChangeLabel";
    206241      this.additiveWeightChangeLabel.Size = new System.Drawing.Size(157, 13);
    207       this.additiveWeightChangeLabel.TabIndex = 0;
     242      this.additiveWeightChangeLabel.TabIndex = 2;
    208243      this.additiveWeightChangeLabel.Text = "Additive weight change (sigma):";
    209244      this.toolTip.SetToolTip(this.additiveWeightChangeLabel, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
     
    214249      this.additiveWeightChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    215250            | System.Windows.Forms.AnchorStyles.Right)));
    216       this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 19);
     251      this.additiveWeightChangeSigmaTextBox.Location = new System.Drawing.Point(201, 39);
    217252      this.additiveWeightChangeSigmaTextBox.Name = "additiveWeightChangeSigmaTextBox";
    218253      this.additiveWeightChangeSigmaTextBox.Size = new System.Drawing.Size(184, 20);
    219       this.additiveWeightChangeSigmaTextBox.TabIndex = 1;
     254      this.additiveWeightChangeSigmaTextBox.TabIndex = 3;
    220255      this.toolTip.SetToolTip(this.additiveWeightChangeSigmaTextBox, "The sigma (std.dev.) parameter for the normal distribution to sample an additive " +
    221256        "change in weight.");
     
    232267      this.tabControl.Name = "tabControl";
    233268      this.tabControl.SelectedIndex = 0;
    234       this.tabControl.Size = new System.Drawing.Size(408, 190);
    235       this.tabControl.TabIndex = 5;
     269      this.tabControl.Size = new System.Drawing.Size(408, 216);
     270      this.tabControl.TabIndex = 9;
    236271      //
    237272      // variableNamesTabPage
     
    240275      this.variableNamesTabPage.Name = "variableNamesTabPage";
    241276      this.variableNamesTabPage.Padding = new System.Windows.Forms.Padding(3);
    242       this.variableNamesTabPage.Size = new System.Drawing.Size(400, 164);
     277      this.variableNamesTabPage.Size = new System.Drawing.Size(400, 190);
    243278      this.variableNamesTabPage.TabIndex = 0;
    244279      this.variableNamesTabPage.Text = "Variable Names";
     
    252287      this.parametersTabPage.Name = "parametersTabPage";
    253288      this.parametersTabPage.Padding = new System.Windows.Forms.Padding(3);
    254       this.parametersTabPage.Size = new System.Drawing.Size(400, 164);
     289      this.parametersTabPage.Size = new System.Drawing.Size(400, 190);
    255290      this.parametersTabPage.TabIndex = 1;
    256291      this.parametersTabPage.Text = "Parameters";
     
    259294      // VariableView
    260295      //
    261       this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    262296      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    263297      this.Controls.Add(this.tabControl);
    264298      this.Name = "VariableView";
    265       this.Size = new System.Drawing.Size(408, 317);
     299      this.Size = new System.Drawing.Size(408, 346);
     300      this.Controls.SetChildIndex(this.enabledCheckBox, 0);
    266301      this.Controls.SetChildIndex(this.maximumArityLabel, 0);
    267302      this.Controls.SetChildIndex(this.maximumArityTextBox, 0);
     
    301336    protected System.Windows.Forms.TabPage parametersTabPage;
    302337    protected System.Windows.Forms.TabControl tabControl;
     338    protected System.Windows.Forms.TextBox varChangeProbTextBox;
     339    protected System.Windows.Forms.Label varChangeProbLabel;
    303340  }
    304341}
  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/VariableView.cs

    r14251 r14759  
    100100      multiplicativeWeightChangeSigmaTextBox.Enabled = Content != null;
    101101      multiplicativeWeightChangeSigmaTextBox.ReadOnly = ReadOnly;
     102      varChangeProbTextBox.Enabled = Content != null;
     103      varChangeProbTextBox.ReadOnly = ReadOnly;
    102104    }
    103105
     
    174176      }
    175177    }
     178
     179    private void VarProbTextBox_TextChanged(object sender, EventArgs e) {
     180      double prob;
     181      if(double.TryParse(varChangeProbTextBox.Text, out prob) && prob >= 0.0 && prob <= 1.0) {
     182        Content.VariableChangeProbability = prob;
     183        errorProvider.SetError(varChangeProbTextBox, string.Empty);
     184      } else {
     185        errorProvider.SetError(varChangeProbTextBox, "Invalid value");
     186      }
     187    }
    176188    #endregion
    177189
     
    183195        additiveWeightChangeSigmaTextBox.Text = string.Empty;
    184196        multiplicativeWeightChangeSigmaTextBox.Text = string.Empty;
     197        varChangeProbTextBox.Text = string.Empty;
    185198        // temporarily deregister to prevent circular calling of events
    186199        DeregisterVariableNamesViewContentEvents();
     
    200213        additiveWeightChangeSigmaTextBox.Text = Content.WeightManipulatorSigma.ToString();
    201214        multiplicativeWeightChangeSigmaTextBox.Text = Content.MultiplicativeWeightManipulatorSigma.ToString();
     215        varChangeProbTextBox.Text = Content.VariableChangeProbability.ToString();
    202216      }
    203217      SetEnabledStateOfControls();
    204218    }
    205219    #endregion
     220
    206221  }
    207222}
  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/VariableBase.cs

    r14758 r14759  
    9292
    9393    public double VariableChangeProbability {
    94       get { return VariableChangeProbability; }
     94      get { return variableChangeProbability; }
    9595      set {
    9696        if(value < 0 || value > 1.0) throw new ArgumentException("Variable change probability must lie in the interval [0..1]");
Note: See TracChangeset for help on using the changeset viewer.