Skip to content

Commit

Permalink
Commented out inverse test for stability
Browse files Browse the repository at this point in the history
Former-commit-id: 25b5490
  • Loading branch information
neubig committed Oct 11, 2016
1 parent afa0679 commit 865f4d1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/test-nodes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -608,14 +608,15 @@ BOOST_AUTO_TEST_CASE( transpose_gradient ) {
BOOST_CHECK(check_grad(mod, z, 0));
}

// Expression trace_of_product(const Expression& x, const Expression& y);
BOOST_AUTO_TEST_CASE( inverse_gradient ) {
dynet::ComputationGraph cg;
Expression x = parameter(cg, param_square1);
Expression y = inverse(x);
Expression z = input(cg, {1,3}, ones3_vals) * y * input(cg, {3,1}, ones3_vals);
BOOST_CHECK(check_grad(mod, z, 0));
}
// inverse is too numerically unstable to test appropriately
// // Expression inverse(const Expression& x);
// BOOST_AUTO_TEST_CASE( inverse_gradient ) {
// dynet::ComputationGraph cg;
// Expression x = parameter(cg, param_square1);
// Expression y = inverse(x);
// Expression z = input(cg, {1,3}, ones3_vals) * y * input(cg, {3,1}, ones3_vals);
// BOOST_CHECK(check_grad(mod, z, 0));
// }

// Expression trace_of_product(const Expression& x, const Expression& y);
BOOST_AUTO_TEST_CASE( trace_of_product_gradient ) {
Expand Down

0 comments on commit 865f4d1

Please sign in to comment.