Changeset 16531 for branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic
- Timestamp:
- 01/14/19 16:41:37 (6 years ago)
- Location:
- branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToAutoDiffTermConverter.cs
r16360 r16531 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, … … 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) && -
branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/BatchOperations.cs
r16356 r16531 69 69 a[i] = Math.Tan(b[i]); 70 70 } 71 public static void Tanh(double[] a, double[] b) { 72 for (int i = 0; i < BATCHSIZE; ++i) 73 a[i] = Math.Tanh(b[i]); 74 } 71 75 72 76 public static void Pow(double[] a, double[] b) { -
branches/2866_SymRegHyperbolicFunctions/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
r16360 r16531 160 160 break; 161 161 } 162 162 case OpCodes.Tanh: { 163 Tanh(instr.buf, code[c].buf); 164 break; 165 } 163 166 case OpCodes.Absolute: { 164 167 Absolute(instr.buf, code[c].buf);
Note: See TracChangeset
for help on using the changeset viewer.