- Timestamp:
- 04/09/21 12:44:50 (4 years ago)
- Location:
- branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Converters/TreeToDiffSharpConverter.cs
r17786 r17930 271 271 var terms = node.Subtrees.Select(ConvertNode).ToList(); 272 272 if (terms.Count == 1) return FunctionApply(terms[0], 273 s => -s,273 s => D.Neg(s), 274 274 v => DV.Neg(v)); 275 275 return terms.Aggregate((a, b) => … … 288 288 (s1, v2) => s1 * v2, 289 289 (v1, s2) => v1 * s2, 290 (v1, v2) => DV. op_DotMultiply(v1, v2)290 (v1, v2) => DV.PointwiseMultiply(v1, v2) 291 291 )); 292 292 } … … 301 301 (s1, v2) => s1 / v2, 302 302 (v1, s2) => v1 / s2, 303 (v1, v2) => DV. op_DotDivide(v1, v2)303 (v1, v2) => DV.PointwiseDivision(v1, v2) 304 304 )); 305 305 } … … 345 345 return FunctionApply(ConvertNode(node.GetSubtree(0)), 346 346 s => D.Sign(s) * D.Pow(D.Abs(s), 1.0 / 3.0), 347 v => DV. op_DotMultiply(DV.Sign(v), DV.Pow(DV.Abs(v), 1.0 / 3.0))347 v => DV.PointwiseMultiply(DV.Sign(v), DV.Pow(DV.Abs(v), 1.0 / 3.0)) 348 348 ); 349 349 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r17830 r17930 113 113 <Private>False</Private> 114 114 </Reference> 115 <Reference Include="DiffSharp , Version=0.7.7.0, Culture=neutral, processorArchitecture=AMD64">115 <Reference Include="DiffSharp.Merged, Version=0.8.4.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=AMD64"> 116 116 <SpecificVersion>False</SpecificVersion> 117 <HintPath>..\..\bin\DiffSharp. dll</HintPath>117 <HintPath>..\..\bin\DiffSharp.Merged.dll</HintPath> 118 118 </Reference> 119 119 <Reference Include="HEAL.Attic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> … … 130 130 <HintPath>..\..\bin\MathNet.Numerics.dll</HintPath> 131 131 </Reference> 132 <Reference Include="netstandard" /> 132 133 <Reference Include="System" /> 133 134 <Reference Include="System.Core"> … … 143 144 <Reference Include="System.Data" /> 144 145 <Reference Include="System.Xml" /> 145 <Reference Include="TensorFlow.NET. Signed, Version=0.15.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">146 <Reference Include="TensorFlow.NET.Merged, Version=0.15.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 146 147 <SpecificVersion>False</SpecificVersion> 147 <HintPath>..\..\bin\TensorFlow.NET. Signed.dll</HintPath>148 <HintPath>..\..\bin\TensorFlow.NET.Merged.dll</HintPath> 148 149 </Reference> 149 150 </ItemGroup> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
r17830 r17930 785 785 s => 0, 786 786 v => { 787 int bins = (int)Math.Round(m.Scalar);787 int bins = Math.Max((int)Math.Round(m.Scalar), 1); 788 788 double minValue = v.Minimum(); 789 789 double maxValue = v.Maximum(); … … 794 794 double binMin = minValue * i; 795 795 double binMax = binMin + intervalWidth; 796 double countBin = v.Map(e => (e > binMin && e < binMax) ? 1 :0).Sum();796 double countBin = v.Map(e => (e > binMin && e < binMax) ? 1.0 : 0.0).Sum(); 797 797 double percBin = countBin / totalValues; 798 798 sum += percBin * Math.Log(percBin); … … 808 808 cur = AggregateApply(cur, 809 809 s => 0, 810 v => Statistics.PopulationStandardDeviation(v) > (Statistics.Maximum(v) - Statistics.Minimum(v)) / 2 ? 1 :0);810 v => Statistics.PopulationStandardDeviation(v) > (Statistics.Maximum(v) - Statistics.Minimum(v)) / 2 ? 1.0 : 0.0); 811 811 TraceEvaluation(currentInstr, cur); 812 812 return cur; … … 816 816 cur = AggregateApply(cur, 817 817 s => 0, 818 v => Statistics.PopulationVariance(v) > Statistics.StandardDeviation(v) ? 1 :0);818 v => Statistics.PopulationVariance(v) > Statistics.StandardDeviation(v) ? 1.0 : 0.0); 819 819 TraceEvaluation(currentInstr, cur); 820 820 return cur; … … 824 824 cur = AggregateApply(cur, 825 825 s => 0, 826 v => Math.Abs(Statistics.Mean(v) - Statistics.Median(v)) < (Statistics.Maximum(v) - Statistics.Minimum(v)) / 2 ? 1 :0);826 v => Math.Abs(Statistics.Mean(v) - Statistics.Median(v)) < (Statistics.Maximum(v) - Statistics.Minimum(v)) / 2 ? 1.0 : 0.0); 827 827 TraceEvaluation(currentInstr, cur); 828 828 return cur; … … 834 834 v => { 835 835 double mean = Statistics.Mean(v); 836 return v.Map(e => e > mean ? 1 :0).Sum();836 return v.Map(e => e > mean ? 1.0 : 0.0).Sum(); 837 837 }); 838 838 TraceEvaluation(currentInstr, cur); … … 845 845 v => { 846 846 double median = Statistics.Median(v); 847 return v.Map(e => e > median ? 1 :0).Sum();847 return v.Map(e => e > median ? 1.0 : 0.0).Sum(); 848 848 }); 849 849 TraceEvaluation(currentInstr, cur); … … 856 856 v => { 857 857 double mean = Statistics.Mean(v); 858 return v.Map(e => e < mean ? 1 :0).Sum();858 return v.Map(e => e < mean ? 1.0 : 0.0).Sum(); 859 859 }); 860 860 TraceEvaluation(currentInstr, cur); … … 867 867 v => { 868 868 double median = Statistics.Median(v); 869 return v.Map(e => e < median ? 1 :0).Sum();869 return v.Map(e => e < median ? 1.0 : 0.0).Sum(); 870 870 }); 871 871 TraceEvaluation(currentInstr, cur); … … 1055 1055 v => { 1056 1056 double sum = 0.0; 1057 int l = (int)Math.Round(lVal.Scalar);1057 int l = Math.Max((int)Math.Round(lVal.Scalar), 0); 1058 1058 double mean = Statistics.Mean(v); 1059 1059 for (int i = 0; i < v.Count - l; i++) { … … 1106 1106 s => 0, 1107 1107 v => { 1108 int lag = (int)Math.Round(l.Scalar);1108 int lag = Math.Max((int)Math.Round(l.Scalar), 0); 1109 1109 double sum = 0.0; 1110 1110 for (int i = 0; i < v.Count - 2 * lag; i++) {
Note: See TracChangeset
for help on using the changeset viewer.