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

Rewrite TemplateExpression to enable hierarchical expressions #365

Merged
merged 59 commits into from
Nov 7, 2024

Conversation

MilesCranmer
Copy link
Owner

  • Created ComposableExpression type for building composable mathematical formulas. You can even call these on other expressions to use them like macros.
  • Added ValidVector wrapper to handle invalid computation results (e.g., NaN) safely within the TemplateExpression
  • Implemented operator overloading for ValidVector to propagate validity flags
  • Added vectorized evaluation support for composable expressions
  • Added tests for interface, evaluation, and error handling

This enables building complex expressions that can be hierarchical (!).

Copy link
Contributor

github-actions bot commented Nov 4, 2024

Benchmark Results

master 113f2c6... master/113f2c6426cdb4...
search/multithreading 23.1 ± 2.8 s 22.6 ± 0.79 s 1.02
search/serial 34.2 ± 0.34 s 34.5 ± 0.2 s 0.992
utils/best_of_sample 2.19 ± 1.7 μs 1.98 ± 1.4 μs 1.11
utils/check_constraints_x10 12.2 ± 3.3 μs 12 ± 3.2 μs 1.02
utils/compute_complexity_x10/Float64 2.09 ± 0.12 μs 2.09 ± 0.11 μs 1
utils/compute_complexity_x10/Int64 2.05 ± 0.11 μs 2.04 ± 0.11 μs 1
utils/compute_complexity_x10/nothing 1.49 ± 0.12 μs 1.48 ± 0.1 μs 1.01
utils/insert_random_op_x10 5.98 ± 1.8 μs 5.71 ± 1.8 μs 1.05
utils/next_generation_x100 0.44 ± 0.068 ms 0.348 ± 0.12 ms 1.26
utils/optimize_constants_x10 0.0398 ± 0.0076 s 0.0401 ± 0.0097 s 0.992
utils/randomly_rotate_tree_x10 5.33 ± 0.6 μs 5.26 ± 0.58 μs 1.01
time_to_load 1.81 ± 0.037 s 1.84 ± 0.044 s 0.981

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@coveralls
Copy link

coveralls commented Nov 4, 2024

Pull Request Test Coverage Report for Build 11717823949

Details

  • 241 of 248 (97.18%) changed or added relevant lines in 15 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 95.422%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/LossFunctions.jl 12 13 92.31%
src/Operators.jl 2 8 25.0%
Files with Coverage Reduction New Missed Lines %
src/SearchUtils.jl 1 90.4%
src/Dataset.jl 1 92.86%
Totals Coverage Status
Change from base Build 11599648113: -0.02%
Covered Lines: 3022
Relevant Lines: 3167

💛 - Coveralls

src/Configure.jl Outdated Show resolved Hide resolved
src/Configure.jl Show resolved Hide resolved
@MilesCranmer MilesCranmer force-pushed the composable-expressions branch 2 times, most recently from 8288720 to 277ffe9 Compare November 7, 2024 05:00
@MilesCranmer MilesCranmer force-pushed the composable-expressions branch from 277ffe9 to 9f0261d Compare November 7, 2024 06:08
@MilesCranmer MilesCranmer merged commit cf4c0c2 into master Nov 7, 2024
16 checks passed
@MilesCranmer MilesCranmer deleted the composable-expressions branch November 7, 2024 06:48
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