Changeset 5467 for trunk/sources
- Timestamp:
- 02/15/11 14:30:55 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 11 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources
- Property svn:mergeinfo changed
/branches/GP.Symbols (TimeLag, Diff, Integral) (added) merged: 5060
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.DataAnalysis (added) merged: 5060
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblemBase.cs
r5445 r5467 282 282 varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.CheckedItems.Select(x => x.Value.Value); 283 283 } 284 foreach (var varSymbol in FunctionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.VariableCondition>()) { 285 varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.CheckedItems.Select(x => x.Value.Value); 286 } 284 287 var globalGrammar = FunctionTreeGrammar as GlobalSymbolicExpressionGrammar; 285 288 if (globalGrammar != null) { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/HeuristicLab.Problems.DataAnalysis.Views-3.3.csproj
r5373 r5467 199 199 <DependentUpon>ConstantView.cs</DependentUpon> 200 200 </Compile> 201 <Compile Include="Symbolic\Symbols\VariableConditionView.cs"> 202 <SubType>UserControl</SubType> 203 </Compile> 204 <Compile Include="Symbolic\Symbols\VariableConditionView.Designer.cs"> 205 <DependentUpon>VariableConditionView.cs</DependentUpon> 206 </Compile> 201 207 <Compile Include="Symbolic\Symbols\LaggedVariableView.cs"> 202 208 <SubType>UserControl</SubType> -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
r5431 r5467 116 116 <Compile Include="Symbolic\TypeCoherentExpressionGrammar.cs" /> 117 117 <Compile Include="Symbolic\Symbols\Power.cs" /> 118 <Compile Include="Symbolic\Symbols\VariableCondition.cs" /> 119 <Compile Include="Symbolic\Symbols\VariableConditionTreeNode.cs" /> 118 120 <Compile Include="TableFileParser.cs" /> 119 121 <None Include="HeuristicLab.snk" /> -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs
r5445 r5467 72 72 derivative.InitialFrequency = 0.0; 73 73 74 var variableCondition = new VariableCondition(); 75 variableCondition.InitialFrequency = 0.0; 76 74 77 var constant = new Constant(); 75 78 constant.MinValue = -20; … … 79 82 laggedVariable.InitialFrequency = 0.0; 80 83 81 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable };84 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition }; 82 85 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not, timeLag, integral, derivative }; 83 86 84 var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt };87 var binaryFunctionSymbols = new List<Symbol>() { pow, root, gt, lt, variableCondition }; 85 88 var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or }; 86 89 var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable }; -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
r5445 r5467 129 129 public const byte Integral = 25; 130 130 public const byte Derivative = 26; 131 132 public const byte VariableCondition = 27; 131 133 } 132 134 … … 158 160 { typeof(Integral), OpCodes.Integral}, 159 161 { typeof(Derivative), OpCodes.Derivative}, 162 { typeof(VariableCondition),OpCodes.VariableCondition} 160 163 }; 161 164 … … 193 196 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName); 194 197 code[i] = instr; 198 } else if (instr.opCode == OpCodes.VariableCondition) { 199 var variableConditionTreeNode = instr.dynamicNode as VariableConditionTreeNode; 200 instr.iArg0 = (ushort)dataset.GetVariableIndex(variableConditionTreeNode.VariableName); 195 201 } 196 202 } … … 201 207 state.Reset(); 202 208 yield return Evaluate(dataset, ref row, state); 203 } 209 } 204 210 } 205 211 … … 398 404 return constTreeNode.Value; 399 405 } 406 407 //mkommend: this symbol uses the logistic function f(x) = 1 / (1 + e^(-alpha * x) ) 408 //to determine the relative amounts of the true and false branch see http://en.wikipedia.org/wiki/Logistic_function 409 case OpCodes.VariableCondition: { 410 var variableConditionTreeNode = (VariableConditionTreeNode)currentInstr.dynamicNode; 411 double variableValue = dataset[row, currentInstr.iArg0]; 412 double x = variableValue - variableConditionTreeNode.Threshold; 413 double p = 1 / (1 + Math.Exp(-variableConditionTreeNode.Slope * x)); 414 415 double trueBranch = Evaluate(dataset, ref row, state); 416 double falseBranch = Evaluate(dataset, ref row, state); 417 418 return trueBranch * p + falseBranch * (1 - p); 419 } 400 420 default: throw new NotSupportedException(); 401 421 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableCondition.cs
r5060 r5467 168 168 : base(name, description) { 169 169 thresholdInitializerMu = 0.0; 170 thresholdInitializerSigma = 1.0;170 thresholdInitializerSigma = 0.1; 171 171 thresholdManipulatorMu = 0.0; 172 thresholdManipulatorSigma = 1.0;172 thresholdManipulatorSigma = 0.1; 173 173 174 174 variableNames = new List<string>(); 175 175 176 176 slopeInitializerMu = 1.0; 177 slopeInitializerSigma = 0. 5;177 slopeInitializerSigma = 0.05; 178 178 slopeManipulatorMu = 0.0; 179 slopeManipulatorSigma = 0. 5;179 slopeManipulatorSigma = 0.05; 180 180 } 181 181 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Symbols/VariableTreeNode.cs
r5445 r5467 55 55 56 56 public override bool HasLocalParameters { 57 get { 58 return true; 59 } 57 get { return true; } 60 58 } 61 59 -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/TypeCoherentExpressionGrammar.cs
r5445 r5467 72 72 var derivative = new Derivative(); 73 73 derivative.InitialFrequency = 0.0; 74 var variableCondition = new VariableCondition(); 75 variableCondition.InitialFrequency = 0.0; 74 76 75 77 var constant = new Constant(); … … 91 93 * UnaryOperator RealValueExpression | 92 94 * "IF" BooleanExpression RealValueExpression RealValueExpression | 95 * "VariableCondition" RealValueExpression RealValueExpression 93 96 * 94 97 * BinaryOperator = … … 106 109 */ 107 110 108 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable };111 var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, pow, root, exp, @if, gt, lt, and, or, not, timeLag, integral, derivative, constant, variableSymbol, laggedVariable, variableCondition }; 109 112 110 113 var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, timeLag, integral, derivative }; 111 var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div, mean, pow, root };114 var binaryFunctionSymbols = new List<Symbol>() { add, sub, mul, div, mean, pow, root, variableCondition }; 112 115 113 116 var unaryBooleanFunctionSymbols = new List<Symbol>() { not }; -
trunk/sources/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.VehicleRouting (added) merged: 5060
- Property svn:mergeinfo changed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views
- Property svn:mergeinfo changed
/branches/GP.Symbols (TimeLag, Diff, Integral)/HeuristicLab.Problems.VehicleRouting.Views (added) merged: 5060
- Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.