Created new visualizer, fixed sonata tags: #219 - #220
Conversation
|
|
|
|
||
| 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) |
There was a problem hiding this comment.
Возможно, искать следует без префикса lib?
|
|
||
| // Return organized population references for projection creation. | ||
| const auto& gate_pop = | ||
| constructor.add_population(default_neuron, classes_amount, PopulationRole::NORMAL, true, "GATE"); // was false |
There was a problem hiding this comment.
Комментарий "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); | ||
|
|
| * 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); |
There was a problem hiding this comment.
Верни тут граф. Никаких скрытых параметров и, тем более, файлов. если я запущу твой визуализатор из нескольких потоков, наверняка всё сломается.
| * 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); |
There was a problem hiding this comment.
И здесь тоже - построй "стек" визуализаторов, но без скрытых переменных и файлов.
| * 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( |
| 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; | ||
| } | ||
| } | ||
| }; |
artiomn
left a comment
There was a problem hiding this comment.
Нужно исправить, как было обговорено.
Part of #219