SymbolicML / DynamicExpressions.jl

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

Deprecate implicit call API #22

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

Taking @Moelf's suggestion in #21, this PR deprecates (softly, using Base.depwarn) the functor syntax tree(X), which implicitly uses the last OperatorEnum() that was created.

This PR replaces it with the explicit functor syntax: tree(X, operators). Likewise for gradients: tree'(X, operators).

@Moelf do you think you could review?

Thanks! Miles


fixes #21

github-actions[bot] commented 1 year ago

Pull Request Test Coverage Report for Build 4710033484


Totals Coverage Status
Change from base Build 4689134023: 0.1%
Covered Lines: 982
Relevant Lines: 1099

💛 - Coveralls
github-actions[bot] commented 1 year ago

Benchmark Results

master 601bd9350f4baa... t[master]/t[601bd9350f4baa...]
OperatorEnum/ComplexF32/evaluation 0.0386 ± 0.0046 ms 0.0364 ± 0.0033 ms 1.06
OperatorEnum/ComplexF64/evaluation 0.0381 ± 0.0029 ms 0.0395 ± 0.0047 ms 0.965
OperatorEnum/Float32/derivative 0.138 ± 0.0021 ms 0.137 ± 0.002 ms 1.01
OperatorEnum/Float32/derivative_turbo 0.164 ± 0.012 ms 0.163 ± 0.014 ms 1
OperatorEnum/Float32/evaluation 8.18 ± 0.48 μs 8.05 ± 0.6 μs 1.02
OperatorEnum/Float32/evaluation_turbo 7.16 ± 0.62 μs 7.26 ± 0.83 μs 0.986
OperatorEnum/Float64/derivative 0.203 ± 0.0045 ms 0.2 ± 0.0046 ms 1.02
OperatorEnum/Float64/derivative_turbo 0.23 ± 0.017 ms 0.228 ± 0.014 ms 1.01
OperatorEnum/Float64/evaluation 12.4 ± 1.2 μs 12 ± 1.3 μs 1.03
OperatorEnum/Float64/evaluation_turbo 11.4 ± 1.2 μs 11.5 ± 1.4 μs 0.991

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).

github-actions[bot] commented 1 year ago

Benchmark Results

master 715000d52c18b4... t[master]/t[715000d52c18b4...]
OperatorEnum/ComplexF32/evaluation 0.0386 ± 0.0017 ms 0.0481 ± 0.016 ms 0.802
OperatorEnum/ComplexF64/evaluation 0.0369 ± 0.0031 ms 0.037 ± 0.002 ms 0.997
OperatorEnum/Float32/derivative 0.13 ± 0.0033 ms 0.128 ± 0.0038 ms 1.02
OperatorEnum/Float32/derivative_turbo 0.176 ± 0.0026 ms 0.175 ± 0.0022 ms 1.01
OperatorEnum/Float32/evaluation 8.27 ± 0.46 μs 8.3 ± 0.4 μs 0.997
OperatorEnum/Float32/evaluation_turbo 7.1 ± 0.48 μs 7.16 ± 0.38 μs 0.992
OperatorEnum/Float64/derivative 0.15 ± 0.0062 ms 0.151 ± 0.0035 ms 0.997
OperatorEnum/Float64/derivative_turbo 0.204 ± 0.0029 ms 0.204 ± 0.0041 ms 1
OperatorEnum/Float64/evaluation 12.1 ± 1.1 μs 12.1 ± 0.83 μs 1
OperatorEnum/Float64/evaluation_turbo 11.4 ± 1.4 μs 11.2 ± 1.2 μs 1.02

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).

github-actions[bot] commented 1 year ago

Benchmark Results

master 8ff81588673290... t[master]/t[8ff81588673290...]
OperatorEnum/ComplexF32/evaluation 0.0385 ± 0.0013 ms 0.0384 ± 0.0016 ms 1
OperatorEnum/ComplexF64/evaluation 0.0369 ± 0.003 ms 0.0365 ± 0.0015 ms 1.01
OperatorEnum/Float32/derivative 0.121 ± 0.0062 ms 0.128 ± 0.0033 ms 0.943
OperatorEnum/Float32/derivative_turbo 0.177 ± 0.0032 ms 0.176 ± 0.0021 ms 1.01
OperatorEnum/Float32/evaluation 7.62 ± 0.52 μs 7.58 ± 0.36 μs 1.01
OperatorEnum/Float32/evaluation_turbo 7.08 ± 0.48 μs 7 ± 0.38 μs 1.01
OperatorEnum/Float64/derivative 0.156 ± 0.005 ms 0.157 ± 0.0043 ms 0.999
OperatorEnum/Float64/derivative_turbo 0.204 ± 0.0044 ms 0.202 ± 0.0033 ms 1.01
OperatorEnum/Float64/evaluation 12.3 ± 1 μs 12 ± 0.9 μs 1.02
OperatorEnum/Float64/evaluation_turbo 11.4 ± 1 μs 11.1 ± 0.9 μs 1.03

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).

Moelf commented 1 year ago

sorry didn't have time to respond in time but this is great and thanks a lot for this!!