SymbolicML / DynamicExpressions.jl

Ridiculously fast symbolic expressions
https://ai.damtp.cam.ac.uk/dynamicexpressions
Apache License 2.0
106 stars 15 forks source link

Create `ParametricExpression` type #81

Closed MilesCranmer closed 4 months ago

MilesCranmer commented 4 months ago

This lets you specify basis functions in DynamicExpressions.jl

@AlCap23 might be useful for your stuff too!

Once merged this will still be in the alpha stage of 0.18 as the interface needs to be tested more.

TODO:

github-actions[bot] commented 4 months ago

Benchmark Results

master 08a0799737f576... master/08a0799737f576...
eval/ComplexF32/evaluation 7.52 ± 0.46 ms 7.53 ± 0.48 ms 0.998
eval/ComplexF64/evaluation 9.87 ± 0.7 ms 9.8 ± 0.72 ms 1.01
eval/Float32/derivative 11.1 ± 2 ms 11.4 ± 2.6 ms 0.97
eval/Float32/derivative_turbo 11.1 ± 1.9 ms 11.6 ± 2.8 ms 0.958
eval/Float32/evaluation 2.8 ± 0.21 ms 2.77 ± 0.23 ms 1.01
eval/Float32/evaluation_bumper 0.547 ± 0.016 ms 0.561 ± 0.014 ms 0.975
eval/Float32/evaluation_turbo 0.725 ± 0.048 ms 0.744 ± 0.034 ms 0.974
eval/Float32/evaluation_turbo_bumper 0.545 ± 0.017 ms 0.563 ± 0.015 ms 0.968
eval/Float64/derivative 14.8 ± 0.94 ms 15.9 ± 0.98 ms 0.93
eval/Float64/derivative_turbo 14.8 ± 0.99 ms 15.8 ± 0.88 ms 0.939
eval/Float64/evaluation 2.93 ± 0.25 ms 2.98 ± 0.23 ms 0.984
eval/Float64/evaluation_bumper 1.21 ± 0.044 ms 1.23 ± 0.045 ms 0.986
eval/Float64/evaluation_turbo 1.2 ± 0.072 ms 1.25 ± 0.068 ms 0.962
eval/Float64/evaluation_turbo_bumper 1.21 ± 0.045 ms 1.23 ± 0.047 ms 0.986
utils/combine_operators/break_sharing 0.0414 ± 0.0013 ms 0.0409 ± 0.0012 ms 1.01
utils/convert/break_sharing 28.5 ± 1.2 μs 28.7 ± 1.4 μs 0.992
utils/convert/preserve_sharing 0.132 ± 0.0052 ms 0.134 ± 0.0047 ms 0.984
utils/copy/break_sharing 29.6 ± 1.3 μs 29.6 ± 1.5 μs 1
utils/copy/preserve_sharing 0.134 ± 0.0053 ms 0.133 ± 0.0043 ms 1.01
utils/count_constants/break_sharing 11.4 ± 0.2 μs 10.6 ± 0.17 μs 1.08
utils/count_constants/preserve_sharing 0.113 ± 0.0041 ms 0.115 ± 0.0031 ms 0.984
utils/count_depth/break_sharing 17.2 ± 0.37 μs 17.9 ± 0.39 μs 0.963
utils/count_nodes/break_sharing 10 ± 0.17 μs 9.95 ± 0.17 μs 1.01
utils/count_nodes/preserve_sharing 0.119 ± 0.0043 ms 0.119 ± 0.0034 ms 1.01
utils/get_set_constants!/break_sharing 0.0518 ± 0.00083 ms 0.121 ± 0.0044 ms 0.427
utils/get_set_constants!/preserve_sharing 0.329 ± 0.0088 ms 0.329 ± 0.01 ms 0.999
utils/has_constants/break_sharing 4.32 ± 0.22 μs 4.34 ± 0.22 μs 0.995
utils/has_operators/break_sharing 1.79 ± 0.025 μs 1.78 ± 0.023 μs 1
utils/hash/break_sharing 0.0325 ± 0.00048 ms 0.0323 ± 0.00047 ms 1.01
utils/hash/preserve_sharing 0.137 ± 0.004 ms 0.138 ± 0.0033 ms 0.994
utils/index_constants/break_sharing 27.8 ± 0.78 μs 27.9 ± 0.92 μs 0.999
utils/index_constants/preserve_sharing 0.13 ± 0.0043 ms 0.133 ± 0.0038 ms 0.977
utils/is_constant/break_sharing 4.73 ± 0.22 μs 4.91 ± 0.22 μs 0.964
utils/simplify_tree/break_sharing 0.159 ± 0.015 ms 0.155 ± 0.015 ms 1.02
utils/simplify_tree/preserve_sharing 0.283 ± 0.018 ms 0.276 ± 0.018 ms 1.03
utils/string_tree/break_sharing 0.419 ± 0.023 ms 0.416 ± 0.022 ms 1.01
utils/string_tree/preserve_sharing 0.554 ± 0.026 ms 0.568 ± 0.036 ms 0.977
time_to_load 0.228 ± 0.0027 s 0.241 ± 0.001 s 0.944
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9629427358

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Interfaces.jl 116 117 99.15%
ext/DynamicExpressionsSymbolicUtilsExt.jl 0 2 0.0%
src/ParametricExpression.jl 130 132 98.48%
<!-- Total: 315 320 98.44% -->
Files with Coverage Reduction New Missed Lines %
src/Expression.jl 1 98.02%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9410352301: 0.3%
Covered Lines: 2133
Relevant Lines: 2229

💛 - Coveralls
github-actions[bot] commented 4 months ago

Pull Request Test Coverage Report for Build 9629532874

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Interfaces.jl 116 117 99.15%
ext/DynamicExpressionsSymbolicUtilsExt.jl 0 2 0.0%
src/ParametricExpression.jl 130 132 98.48%
<!-- Total: 315 320 98.44% -->
Files with Coverage Reduction New Missed Lines %
src/Expression.jl 1 98.02%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9410352301: 0.3%
Covered Lines: 2133
Relevant Lines: 2229

💛 - Coveralls
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9629532874

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Interfaces.jl 116 117 99.15%
ext/DynamicExpressionsSymbolicUtilsExt.jl 0 2 0.0%
src/ParametricExpression.jl 130 132 98.48%
<!-- Total: 315 320 98.44% -->
Files with Coverage Reduction New Missed Lines %
src/Expression.jl 1 98.02%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9410352301: 0.3%
Covered Lines: 2133
Relevant Lines: 2229

💛 - Coveralls
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9629574295

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Interfaces.jl 116 117 99.15%
ext/DynamicExpressionsSymbolicUtilsExt.jl 0 2 0.0%
src/ParametricExpression.jl 130 132 98.48%
<!-- Total: 315 320 98.44% -->
Files with Coverage Reduction New Missed Lines %
src/Expression.jl 1 98.02%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9410352301: 0.3%
Covered Lines: 2133
Relevant Lines: 2229

💛 - Coveralls
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9629591744

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Interfaces.jl 116 117 99.15%
ext/DynamicExpressionsSymbolicUtilsExt.jl 0 2 0.0%
src/ParametricExpression.jl 130 132 98.48%
<!-- Total: 315 320 98.44% -->
Files with Coverage Reduction New Missed Lines %
src/Expression.jl 1 98.02%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9410352301: 0.3%
Covered Lines: 2133
Relevant Lines: 2229

💛 - Coveralls
coveralls commented 4 months ago

Pull Request Test Coverage Report for Build 9629622189

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Interfaces.jl 116 117 99.15%
ext/DynamicExpressionsSymbolicUtilsExt.jl 0 2 0.0%
src/ParametricExpression.jl 130 132 98.48%
<!-- Total: 315 320 98.44% -->
Files with Coverage Reduction New Missed Lines %
src/Expression.jl 1 98.02%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 9410352301: 0.3%
Covered Lines: 2133
Relevant Lines: 2229

💛 - Coveralls