Skip to content

Created new visualizer, fixed sonata tags: #219 - #220

Open
NeZero2020 wants to merge 11 commits into
KasperskyLab:masterfrom
NeZero2020:feature/visualizer
Open

Created new visualizer, fixed sonata tags: #219#220
NeZero2020 wants to merge 11 commits into
KasperskyLab:masterfrom
NeZero2020:feature/visualizer

Conversation

@NeZero2020

Copy link
Copy Markdown

Part of #219

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@artiomn artiomn changed the title Changed the visualizer, fixed sonata tags: #219 Created new visualizer, fixed sonata tags: #219 Aug 5, 2026
Comment thread examples/mnist-client/CMakeLists.txt Outdated

target_link_libraries(mnist-client PRIVATE KNP::BaseFramework::Core ${OpenCV_LIBS} ${Boost_LIBRARIES})
find_package(PkgConfig REQUIRED)
pkg_check_modules(GRAPHVIZ REQUIRED IMPORTED_TARGET libgvc libcgraph)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Возможно, искать следует без префикса lib?

Comment thread examples/mnist-client/main.cpp

// Return organized population references for projection creation.
const auto& gate_pop =
constructor.add_population(default_neuron, classes_amount, PopulationRole::NORMAL, true, "GATE"); // was false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Комментарий "was false" вводит в заблуждения и не несёт смысловой нагрузки, - лучше убрать или дополнить.


// Create target population for label processing (10 neurons for 10 digit classes).
const auto &target_pop = constructor.add_channeled_population(classes_amount, false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

А это зачем удалять?

* For the change save directory, use set_saving_path(directory).
*/
KNP_DECLSPEC void print_modified_network_description(const NetworkGraph &graph);
KNP_DECLSPEC void visualize_network(const knp::framework::Network& network);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Верни тут граф. Никаких скрытых параметров и, тем более, файлов. если я запущу твой визуализатор из нескольких потоков, наверняка всё сломается.

* By default, it saves dot/png files of graph to the current directory (the visualization directory is being created).
* For the change save directory, use set_saving_path(directory).
*/
KNP_DECLSPEC void visualize_network(const knp::framework::Model& model);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

И здесь тоже - построй "стек" визуализаторов, но без скрытых переменных и файлов.

* By default, it saves dot/png files of graph to the current directory (the visualization directory is being created).
* For the change save directory, use set_saving_path(directory).
*/
KNP_DECLSPEC void visualize_network(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Тоже самое.

Comment on lines +268 to +300
struct ConfigVisualizePathes
{
std::string mode = "static";
std::string name;

inline static std::string default_path = "visualization_docs";
std::string dir;
std::string name_dot_file;
std::string name_png_file;

ConfigVisualizePathes() { init(); }

explicit ConfigVisualizePathes(const std::string& mode_val) : mode(mode_val) { init(); }

private:
void init()
{
name = "graph_" + mode;
dir = default_path;
name_dot_file = dir + "/dot_files/" + name + ".dot";
name_png_file = dir + "/png_files/" + name + ".png";

try
{
std::filesystem::create_directories(dir + "/dot_files");
std::filesystem::create_directories(dir + "/png_files");
}
catch (const std::filesystem::filesystem_error& ex)
{
std::cerr << "Failed to create directories: " << ex.what() << std::endl;
}
}
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Удалить.

@artiomn artiomn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Нужно исправить, как было обговорено.

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