Skip to content

Commit

Permalink
update autodiff unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
foolnotion committed Aug 13, 2023
1 parent 1f11336 commit a64e051
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions test/source/implementation/autodiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "operon/core/problem.hpp"
#include "operon/formatter/formatter.hpp"
#include "operon/interpreter/interpreter.hpp"
#include "operon/interpreter/tape.hpp"
#include "operon/operators/creator.hpp"
#include "operon/operators/initializer.hpp"
#include "operon/parser/infix.hpp"
Expand Down Expand Up @@ -54,29 +53,6 @@ TEST_CASE("reverse mode" * dt::test_suite("[autodiff]")) {
fmt::print(fmt::fg(fmt::color::orange), "infix: {}\n", Operon::InfixFormatter::Format(tree, ds));

fmt::print("{}\n", Operon::DotFormatter::Format(tree, ds));
//auto revMap = Operon::Tape{tree}.Map();
//auto const& nodes = tree.Nodes();
//for (auto i = 0; i < std::ssize(nodes); ++i) {
// auto u = tree.Splice(i);
// if (nodes[i].Optimize) {
// auto it = revMap.find(i);
// ENSURE(it != revMap.end());
// fmt::print("∂f/∂{} => {}\n", Operon::InfixFormatter::Format(u, ds), Operon::InfixFormatter::Format(it->second, ds));
// }
// if (nodes[i].IsLeaf()) { continue; }
// for (auto j : Tree::Indices(nodes, i)) {
// auto v = tree.Splice(j);
// auto it = revMap.find(j);
// ENSURE(it != revMap.end());
// fmt::print("∂{}/∂{} => {}\n\n", Operon::InfixFormatter::Format(u, ds), Operon::InfixFormatter::Format(v, ds), Operon::InfixFormatter::Format(it->second, ds));
// }
//}
//for (auto&& [i, v] : revMap) {
// auto u = tree.Splice(i);
// fmt::print(fmt::fg(fmt::color::red), "subtree {}: ADJ({}) => {}\n", i, Operon::InfixFormatter::Format(u, ds), Operon::InfixFormatter::Format(v, ds));
// fmt::print("{}\n", Operon::DotFormatter::Format(u, ds));
// fmt::print("{}\n", Operon::DotFormatter::Format(v, ds));
//}

std::vector<Operon::Scalar> y(ds.Rows());
Operon::Span<Operon::Scalar> target{y.data(), y.size()};
Expand Down

0 comments on commit a64e051

Please sign in to comment.