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

adds reduce_sum and tests #1813

Merged
merged 50 commits into from
Apr 8, 2020
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
7fe241e
adds reduce_sum and tests
SteveBronder Mar 31, 2020
ec78eb6
remove stan::math::test namespace for now
SteveBronder Mar 31, 2020
65e6526
[Jenkins] auto-formatting by clang-format version 5.0.0-3~16.04.1 (ta…
stan-buildbot Mar 31, 2020
928898b
cpplint
SteveBronder Mar 31, 2020
9d48fab
merge static and normal reduce_sum tests for mix and prim
SteveBronder Apr 1, 2020
c554db8
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Apr 1, 2020
c3795da
make static tests for rev
SteveBronder Apr 1, 2020
07991a5
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Apr 1, 2020
c0ff21d
cpplint
SteveBronder Apr 1, 2020
92e5686
Add header includes
SteveBronder Apr 1, 2020
acf754e
reduce_sum headers
SteveBronder Apr 1, 2020
df6ab63
header stuff
SteveBronder Apr 1, 2020
6723026
break reduce_sum mix tests into two seperate headers
SteveBronder Apr 1, 2020
bc7d174
split test files
rok-cesnovar Apr 2, 2020
cc9e120
Merge commit 'b225daf197c8b1f97539de408ee12eae26807b7a' into HEAD
yashikno Apr 2, 2020
c9105b9
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Apr 2, 2020
a6ae88c
newline
rok-cesnovar Apr 2, 2020
6f68ab7
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Apr 2, 2020
8e94437
Handling review comments (Issue #1815, reduce_sum)
bbbales2 Apr 2, 2020
faf4914
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Apr 2, 2020
065a61d
Updated tests to include zero length sliced arrays (Issue #1815)
bbbales2 Apr 2, 2020
a4a00a9
Merge branch 'feature/reduce_sum' of https://github.com/stan-dev/math…
bbbales2 Apr 2, 2020
198f70f
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
stan-buildbot Apr 2, 2020
27fb3d1
fix test name
SteveBronder Apr 3, 2020
88913c7
fix reduce sum using statements for test
SteveBronder Apr 3, 2020
ace0bbb
Added tests for threading. Moved generic reduce_sum implementation to…
bbbales2 Apr 3, 2020
dbff2f3
Merge commit '24c9c861b9ec5cda11f41b3bdb9900626181dd96' into HEAD
yashikno Apr 3, 2020
560c293
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Apr 3, 2020
04e412b
Shuffled reduce_sum test utils includes to avoid including mix into p…
bbbales2 Apr 3, 2020
f83cda5
Merge branch 'feature/reduce_sum' of https://github.com/stan-dev/math…
bbbales2 Apr 3, 2020
63e7a35
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Apr 3, 2020
128c10e
Added missing headers to tests (Issue #1815)
bbbales2 Apr 3, 2020
ecb3d6b
Merge branch 'feature/reduce_sum' of https://github.com/stan-dev/math…
bbbales2 Apr 3, 2020
9301d9e
Updated reduce_sum_static to perform as described even without thread…
bbbales2 Apr 3, 2020
38f1141
[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.0…
stan-buildbot Apr 3, 2020
fe7007a
Made it so that if reduce_sum_static is called without STAN_THREADS i…
bbbales2 Apr 3, 2020
22861a5
Merge branch 'feature/reduce_sum' of https://github.com/stan-dev/math…
bbbales2 Apr 3, 2020
4c68c63
Responding to code review (Issue #1815)
bbbales2 Apr 6, 2020
1fed7f8
Merge commit 'fee10a80ad1d0d8c72f0990dc9652e5c6296d4e9' into HEAD
yashikno Apr 6, 2020
e10b626
[Jenkins] auto-formatting by clang-format version 6.0.0
stan-buildbot Apr 6, 2020
7f76760
Added std::forward calls to rev version of reduce_sum (Issue #1815)
bbbales2 Apr 7, 2020
2658e80
[Jenkins] auto-formatting by clang-format version 6.0.0
stan-buildbot Apr 7, 2020
7f893d5
Revert "Added std::forward calls to rev version of reduce_sum (Issue …
bbbales2 Apr 7, 2020
870be5a
Merge branch 'feature/reduce_sum' of https://github.com/stan-dev/math…
bbbales2 Apr 7, 2020
ccee1f1
Added std::forward calls to rev version of reduce_sum again (Issue #1…
bbbales2 Apr 7, 2020
5bd7f91
[Jenkins] auto-formatting by clang-format version 6.0.0
stan-buildbot Apr 7, 2020
ad02fdf
Add STAN_NUM_THREADS to jenkinsfile, inline reduce_sum operators
SteveBronder Apr 7, 2020
dcfffc5
[Jenkins] auto-formatting by clang-format version 6.0.0
stan-buildbot Apr 7, 2020
2ea9a7b
remove export from windows threading test
SteveBronder Apr 7, 2020
8d8ebd1
Merge branch 'feature/reduce_sum' of github.com:stan-dev/math into fe…
SteveBronder Apr 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/…
…stable/2017-11-14)
  • Loading branch information
stan-buildbot committed Apr 1, 2020
commit 07991a5e109e5d80cc9044738c79c3d82c09b240
32 changes: 18 additions & 14 deletions test/unit/math/rev/functor/reduce_sum_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ TEST(StanMathRev_reduce_sum, value) {
<< "ref value of poisson lpdf : " << poisson_lpdf_ref << std::endl
<< "value of poisson lpdf : " << poisson_lpdf << std::endl;

double poisson_lpdf_static = stan::math::reduce_sum_static<count_lpdf<double>>(
data, 5, get_new_msg(), vlambda_d, idata);
double poisson_lpdf_static
= stan::math::reduce_sum_static<count_lpdf<double>>(
data, 5, get_new_msg(), vlambda_d, idata);

EXPECT_FLOAT_EQ(poisson_lpdf_static, poisson_lpdf_ref);
}
Expand Down Expand Up @@ -77,7 +78,6 @@ TEST(StanMathRev_reduce_sum, gradient) {
<< "value of poisson lpdf : " << poisson_lpdf.val() << std::endl
<< "gradient wrt to lambda: " << lambda_adj << std::endl;


var poisson_lpdf_static = stan::math::reduce_sum_static<count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, idata);

Expand Down Expand Up @@ -122,12 +122,12 @@ TEST(StanMathRev_reduce_sum, grainsize) {
EXPECT_NO_THROW(stan::math::reduce_sum<count_lpdf<var>>(
data, 2 * elems, get_new_msg(), vlambda_v, idata));

EXPECT_THROW(stan::math::reduce_sum_static<count_lpdf<var>>(data, 0, get_new_msg(),
vlambda_v, idata),
EXPECT_THROW(stan::math::reduce_sum_static<count_lpdf<var>>(
data, 0, get_new_msg(), vlambda_v, idata),
std::domain_error);

EXPECT_THROW(stan::math::reduce_sum_static<count_lpdf<var>>(data, -1, get_new_msg(),
vlambda_v, idata),
EXPECT_THROW(stan::math::reduce_sum_static<count_lpdf<var>>(
data, -1, get_new_msg(), vlambda_v, idata),
std::domain_error);

EXPECT_NO_THROW(stan::math::reduce_sum_static<count_lpdf<var>>(
Expand Down Expand Up @@ -180,8 +180,9 @@ TEST(StanMathRev_reduce_sum, nesting_gradient) {
<< "value of poisson lpdf : " << poisson_lpdf.val() << std::endl
<< "gradient wrt to lambda: " << lambda_adj << std::endl;

var poisson_lpdf_static = stan::math::reduce_sum_static<nesting_count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, idata);
var poisson_lpdf_static
= stan::math::reduce_sum_static<nesting_count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, idata);

stan::math::set_zero_all_adjoints();
stan::math::grad(poisson_lpdf_static.vi_);
Expand Down Expand Up @@ -244,8 +245,9 @@ TEST(StanMathRev_reduce_sum, grouped_gradient) {
<< "value of poisson lpdf : " << poisson_lpdf.val() << std::endl
<< "gradient wrt to lambda: " << lambda_adj << std::endl;

var poisson_lpdf_static = stan::math::reduce_sum_static<grouped_count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, gidx);
var poisson_lpdf_static
= stan::math::reduce_sum_static<grouped_count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, gidx);

stan::math::set_zero_all_adjoints();
stan::math::grad(poisson_lpdf_static.vi_);
Expand Down Expand Up @@ -306,8 +308,9 @@ TEST(StanMathRev_reduce_sum, grouped_gradient_eigen) {
<< "value of poisson lpdf : " << poisson_lpdf.val() << std::endl
<< "gradient wrt to lambda: " << lambda_adj << std::endl;

var poisson_lpdf_static = stan::math::reduce_sum_static<grouped_count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, gidx);
var poisson_lpdf_static
= stan::math::reduce_sum_static<grouped_count_lpdf<var>>(
data, 5, get_new_msg(), vlambda_v, gidx);

stan::math::set_zero_all_adjoints();
stan::math::grad(poisson_lpdf_static.vi_);
Expand Down Expand Up @@ -377,7 +380,8 @@ TEST(StanMathRev_reduce_sum, slice_group_gradient) {
<< "value of poisson lpdf : " << poisson_lpdf.val() << std::endl
<< "gradient wrt to lambda: " << lambda_adj << std::endl;

var poisson_lpdf_static = stan::math::reduce_sum_static<slice_group_count_lpdf<var>>(
var poisson_lpdf_static
= stan::math::reduce_sum_static<slice_group_count_lpdf<var>>(
vlambda_v, 5, get_new_msg(), data, gsidx);

stan::math::set_zero_all_adjoints();
Expand Down