Skip to content

Commit

Permalink
Add debug print for parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Apr 14, 2024
1 parent cad41d8 commit 009d7a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 10 additions & 4 deletions include/stichwort/parameter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,21 @@ class ParametersSet
}
void merge(const ParametersSet& pg)
{
typedef ParametersMap::const_iterator MapIter;
for (MapIter iter = pg.pmap.begin(); iter != pg.pmap.end(); ++iter)
for (auto each : pg.pmap)
{
if (!pmap.count(iter->first))
if (!pmap.count(each.first))
{
pmap[iter->first] = iter->second;
pmap[each.first] = each.second;
}
}
}
void visit(std::function<void(const Parameter&)> visitor)
{
for (auto each : pmap)
{
visitor(each.second);
}
}
Parameter operator[](const std::string& name) const
{
ParametersMap::const_iterator it = pmap.find(name);
Expand Down
3 changes: 3 additions & 0 deletions include/tapkee/embed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ TapkeeOutput embed(RandomAccessIterator begin, RandomAccessIterator end, KernelC
{
parameters.check();
parameters.merge(tapkee_internal::defaults);
parameters.visit([] (const stichwort::Parameter& p) {
tapkee::LoggingSingleton::instance().message_debug(fmt::format("Parameter {} = [{}]", p.name(), p.repr()));
});

DimensionReductionMethod selected_method = parameters[method];

Expand Down

0 comments on commit 009d7a8

Please sign in to comment.