Changeset 16722 for branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
- Timestamp:
- 03/28/19 11:22:24 (5 years ago)
- Location:
- branches/2988_ModelsOfModels2
- Files:
-
- 1 added
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
branches/2988_ModelsOfModels2/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r16565 r16722 20 20 #endregion 21 21 22 using AutoDiff; 23 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 22 24 using System; 23 25 using System.Collections.Generic; 24 26 using System.Linq; 25 27 using System.Runtime.Serialization; 26 using AutoDiff;27 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;28 28 29 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { … … 76 76 eval: Math.Tan, 77 77 diff: x => 1 + Math.Tan(x) * Math.Tan(x)); 78 78 private static readonly Func<Term, UnaryFunc> tanh = UnaryFunc.Factory( 79 eval: Math.Tanh, 80 diff: x => 1 - Math.Tanh(x) * Math.Tanh(x)); 79 81 private static readonly Func<Term, UnaryFunc> erf = UnaryFunc.Factory( 80 82 eval: alglib.errorfunction, … … 249 251 if (node.Symbol is CubeRoot) { 250 252 return AutoDiff.TermBuilder.Power( 251 ConvertToAutoDiff(node.GetSubtree(0)), 1.0 /3.0);253 ConvertToAutoDiff(node.GetSubtree(0)), 1.0 / 3.0); 252 254 } 253 255 if (node.Symbol is Sine) { … … 261 263 if (node.Symbol is Tangent) { 262 264 return tan( 265 ConvertToAutoDiff(node.GetSubtree(0))); 266 } 267 if (node.Symbol is HyperbolicTangent) { 268 return tanh( 263 269 ConvertToAutoDiff(node.GetSubtree(0))); 264 270 } … … 321 327 !(n.Symbol is Cosine) && 322 328 !(n.Symbol is Tangent) && 329 !(n.Symbol is HyperbolicTangent) && 323 330 !(n.Symbol is Erf) && 324 331 !(n.Symbol is Norm) &&
Note: See TracChangeset
for help on using the changeset viewer.