Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add built-in random sampling #57

Merged
merged 15 commits into from
Dec 27, 2023
Merged

Add built-in random sampling #57

merged 15 commits into from
Dec 27, 2023

Conversation

MilesCranmer
Copy link
Member

@MilesCranmer MilesCranmer commented Dec 26, 2023

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:

  • Add NodeSampler to docs

Copy link
Contributor

github-actions bot commented Dec 26, 2023

Benchmark Results

master 6d591ed... t[master]/t[6d591ed...]
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

@SymbolicML SymbolicML deleted a comment from sweep-ai bot Dec 26, 2023
@coveralls
Copy link

coveralls commented Dec 26, 2023

Pull Request Test Coverage Report for Build 7336937036

  • 29 of 29 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 94.254%

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

💛 - Coveralls

@MilesCranmer MilesCranmer merged commit cecad13 into master Dec 27, 2023
12 checks passed
MilesCranmer added a commit that referenced this pull request Dec 28, 2023
[Diff since v0.14.0](v0.14.0...v0.14.1)

**Merged pull requests:**
- Add built-in random sampling (#57) (@MilesCranmer)
- Add better errors for `rand` (#58) (@MilesCranmer)
MilesCranmer added a commit that referenced this pull request Jan 25, 2024
[Diff since v0.14.0](v0.14.0...v0.14.1)

**Merged pull requests:**
- Add built-in random sampling (#57) (@MilesCranmer)
- Add better errors for `rand` (#58) (@MilesCranmer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants