Skip to content

Conversation

@t4c1
Copy link
Contributor

@t4c1 t4c1 commented Sep 11, 2020

Summary

Generalizes normal distribution related fucntions to accept Eigen expressions.

Tests

Tested using expression testing framework.

Side Effects

None.

Release notes

Generalized normal distribution related fucntions to accept Eigen expressions.

Checklist

  • Math issue Generalize matrix function signatures #1470

  • Copyright holder: Tadej Ciglarič

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@t4c1
Copy link
Contributor Author

t4c1 commented Sep 11, 2020

@bbbales2 This PR also contains those moves you did not like. However I just remembered that fwd implementation of ops_partials_edge uses regular Eigen matrices for partials_, so doing moves can benefit fwd (and it does not hurt rev).

bbbales2
bbbales2 previously approved these changes Sep 11, 2020
Copy link
Member

@bbbales2 bbbales2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.24 3.92 1.08 7.51% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.96 -3.69% slower
eight_schools/eight_schools.stan 0.09 0.12 0.78 -28.05% slower
gp_regr/gp_regr.stan 0.18 0.18 1.01 1.01% faster
irt_2pl/irt_2pl.stan 6.53 6.11 1.07 6.47% faster
performance.compilation 88.29 88.77 0.99 -0.55% slower
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.34 9.16 0.91 -9.92% slower
pkpd/one_comp_mm_elim_abs.stan 29.55 29.4 1.01 0.5% faster
sir/sir.stan 130.83 135.88 0.96 -3.86% slower
gp_regr/gen_gp_data.stan 0.05 0.05 0.99 -1.09% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.33 3.17 1.05 4.86% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.39 0.38 1.05 4.36% faster
arK/arK.stan 2.56 1.85 1.39 27.8% faster
arma/arma.stan 0.72 0.74 0.97 -3.6% slower
garch/garch.stan 0.73 0.7 1.04 3.43% faster
Mean result: 1.01665117111

Jenkins Console Log
Blue Ocean
Commit hash: f7de716


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

@stan-buildbot
Copy link
Contributor


Name Old Result New Result Ratio Performance change( 1 - new / old )
gp_pois_regr/gp_pois_regr.stan 4.28 3.78 1.13 11.72% faster
low_dim_corr_gauss/low_dim_corr_gauss.stan 0.02 0.02 0.97 -3.47% slower
eight_schools/eight_schools.stan 0.09 0.12 0.76 -31.49% slower
gp_regr/gp_regr.stan 0.18 0.18 0.97 -2.98% slower
irt_2pl/irt_2pl.stan 6.61 6.04 1.09 8.64% faster
performance.compilation 88.72 88.56 1.0 0.17% faster
low_dim_gauss_mix_collapse/low_dim_gauss_mix_collapse.stan 8.2 9.15 0.9 -11.58% slower
pkpd/one_comp_mm_elim_abs.stan 28.95 30.18 0.96 -4.25% slower
sir/sir.stan 128.97 131.62 0.98 -2.06% slower
gp_regr/gen_gp_data.stan 0.05 0.05 1.0 -0.18% slower
low_dim_gauss_mix/low_dim_gauss_mix.stan 3.3 3.17 1.04 3.89% faster
pkpd/sim_one_comp_mm_elim_abs.stan 0.4 0.39 1.03 2.89% faster
arK/arK.stan 2.56 1.94 1.32 24.31% faster
arma/arma.stan 0.73 0.75 0.97 -3.4% slower
garch/garch.stan 0.73 0.7 1.04 3.47% faster
Mean result: 1.01033361315

Jenkins Console Log
Blue Ocean
Commit hash: f7de716


Machine information ProductName: Mac OS X ProductVersion: 10.11.6 BuildVersion: 15G22010

CPU:
Intel(R) Xeon(R) CPU E5-1680 v2 @ 3.00GHz

G++:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Clang:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.6.0
Thread model: posix

Copy link
Member

@bbbales2 bbbales2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good!

@bbbales2 bbbales2 merged commit 5a18d75 into stan-dev:develop Sep 24, 2020
@rok-cesnovar rok-cesnovar deleted the generalize_normal branch September 24, 2020 17:58
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.

3 participants