SymbolicML / DynamicExpressions.jl

Ridiculously fast symbolic expressions
https://symbolicml.org/DynamicExpressions.jl/dev
Apache License 2.0
90 stars 11 forks source link

Add built-in random sampling #57

Closed MilesCranmer closed 5 months ago

MilesCranmer commented 5 months ago

This moves all the random sampling of nodes into DynamicExpressions.jl. It also makes things more explicit with respect to sampling graph nodes. For example, should one sample a GraphNode with the same probability, or proportional to how many times it is used in upstream nodes? This allows you to choose both.

TODO:

github-actions[bot] commented 5 months ago

Benchmark Results

master 6d591edf9e227b... t[master]/t[6d591edf9e227b...]
eval/ComplexF32/evaluation 7.42 ± 0.5 ms 7.36 ± 0.43 ms 1.01
eval/ComplexF64/evaluation 9.59 ± 0.7 ms 9.65 ± 0.7 ms 0.994
eval/Float32/derivative 11 ± 2.2 ms 10.7 ± 1.7 ms 1.03
eval/Float32/derivative_turbo 12.4 ± 2.2 ms 12.5 ± 1.8 ms 0.998
eval/Float32/evaluation 2.73 ± 0.22 ms 2.66 ± 0.23 ms 1.03
eval/Float32/evaluation_turbo 0.653 ± 0.033 ms 0.649 ± 0.035 ms 1.01
eval/Float64/derivative 14.8 ± 0.74 ms 14.4 ± 0.71 ms 1.03
eval/Float64/derivative_turbo 15.6 ± 0.64 ms 15.2 ± 0.68 ms 1.03
eval/Float64/evaluation 2.91 ± 0.25 ms 2.85 ± 0.24 ms 1.02
eval/Float64/evaluation_turbo 1.17 ± 0.062 ms 1.13 ± 0.062 ms 1.04
utils/combine_operators/break_sharing 0.0398 ± 0.0024 ms 0.0401 ± 0.0025 ms 0.991
utils/convert/break_sharing 28.8 ± 0.81 μs 28.5 ± 0.73 μs 1.01
utils/convert/preserve_sharing 0.132 ± 0.004 ms 0.13 ± 0.0033 ms 1.01
utils/copy/break_sharing 29.2 ± 0.73 μs 29.4 ± 0.67 μs 0.992
utils/copy/preserve_sharing 0.131 ± 0.0036 ms 0.128 ± 0.0031 ms 1.02
utils/count_constants/break_sharing 11.4 ± 0.22 μs 11.4 ± 0.25 μs 0.996
utils/count_constants/preserve_sharing 0.114 ± 0.0031 ms 0.113 ± 0.0026 ms 1.01
utils/count_depth/break_sharing 17.8 ± 0.48 μs 17.7 ± 0.45 μs 1.01
utils/count_nodes/break_sharing 10.2 ± 0.18 μs 10.4 ± 0.19 μs 0.975
utils/count_nodes/preserve_sharing 0.117 ± 0.0032 ms 0.116 ± 0.0032 ms 1
utils/get_set_constants!/break_sharing 0.054 ± 0.0009 ms 0.0542 ± 0.00088 ms 0.997
utils/get_set_constants!/preserve_sharing 0.327 ± 0.0075 ms 0.328 ± 0.0071 ms 0.995
utils/has_constants/break_sharing 4.61 ± 0.24 μs 4.57 ± 0.22 μs 1.01
utils/has_operators/break_sharing 1.78 ± 0.02 μs 1.91 ± 0.022 μs 0.929
utils/hash/break_sharing 28.9 ± 0.54 μs 30.3 ± 0.58 μs 0.953
utils/index_constants/break_sharing 28.3 ± 0.78 μs 28.2 ± 0.77 μs 1
utils/index_constants/preserve_sharing 0.132 ± 0.0037 ms 0.131 ± 0.0037 ms 1.01
utils/is_constant/break_sharing 4.89 ± 0.23 μs 4.58 ± 0.24 μs 1.07
utils/simplify_tree/break_sharing 0.264 ± 0.021 ms 0.251 ± 0.02 ms 1.05
utils/simplify_tree/preserve_sharing 0.381 ± 0.024 ms 0.41 ± 0.023 ms 0.93
utils/string_tree/break_sharing 0.591 ± 0.017 ms 0.577 ± 0.014 ms 1.02
utils/string_tree/preserve_sharing 0.729 ± 0.023 ms 0.714 ± 0.018 ms 1.02
utils/hash/preserve_sharing 0.136 ± 0.0033 ms
time_to_load 0.707 ± 0.0058 s 0.699 ± 0.014 s 1.01
coveralls commented 5 months ago

Pull Request Test Coverage Report for Build 7336937036


Totals Coverage Status
Change from base Build 7257779121: 0.6%
Covered Lines: 1263
Relevant Lines: 1340

💛 - Coveralls