Implement subgraph to node, subgraph to subgraph replacement#270
Implement subgraph to node, subgraph to subgraph replacement#270
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #270 +/- ##
==========================================
+ Coverage 83.95% 84.33% +0.38%
==========================================
Files 56 57 +1
Lines 3097 3263 +166
Branches 1855 1991 +136
==========================================
+ Hits 2600 2752 +152
- Misses 245 248 +3
- Partials 252 263 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| std::vector<std::vector<int>> subs_c = subs; | ||
| std::vector<bool> sub_used(subs.size(), true); | ||
| std::vector<int> roots; | ||
| std::vector<int> leafs; |
There was a problem hiding this comment.
Here and in other places: leaf -> leaves
| std::vector<int> roots; | ||
| std::vector<int> leafs; | ||
| std::vector<int> roots2; | ||
| std::vector<int> leafs2; |
There was a problem hiding this comment.
Maybe it is better to give them more descriptive names, like the ones with suffixes _from and _to?
include/graph/graph.hpp
Outdated
|
|
||
| [[nodiscard]] std::vector<int> getOutLayers(size_t layerID) const { | ||
| if (layerID >= layers_.size()) { | ||
| throw std::invalid_argument("Input edges array do not contain this ID."); |
| sub_used[i] = false; | ||
| continue; | ||
| } | ||
| std::shared_ptr<Layer> layer = std::make_shared<EWLayer>("relu"); |
There was a problem hiding this comment.
Does it really make sense to support only relu activation here? It looks like that it could be easily generalized to any elementwise or elementwise activation layer.
There was a problem hiding this comment.
Changed arguments of changed_subgraphs() function, now it can use any kind of layer
|
|
||
| namespace it_lab_ai { | ||
|
|
||
| struct IOOrder { |
There was a problem hiding this comment.
Could you please explain the meaning of IOOrder struct here? Is it actually checked?
There was a problem hiding this comment.
It is used to connect inputs and outputs of new subgraphs with base graph with any order, by default order is defined by node IDs
Closes #219