BuildGraph for GoogleNet, DenseNet, ResNet, Yolo. Add MatMul_Layer, SoftMax_Layer, Reshape_Layer, BatchNormalization_Layer. Modificates for FCLayer, Flatten, Pooling, Convolution. Add universal accuracy check#212
Conversation
6997efa to
c06e0cd
Compare
| input_layer->setName(it_lab_ai::kInput); | ||
| layers.push_back(input_layer); | ||
| if (json_path == MODEL_PATH_RESNET_ONNX || | ||
| json_path == MODEL_PATH_DENSENET_ONNX) { | ||
| name_to_layer["x"] = input_layer; | ||
| } else if (json_path == MODEL_PATH_GOOGLENET_ONNX) { | ||
| name_to_layer["image_tensor"] = input_layer; | ||
| } else { | ||
| name_to_layer["images"] = input_layer; | ||
| } |
There was a problem hiding this comment.
This should be specified as a parameter, so we will have no need to hardcode every input layer name for each net
There was a problem hiding this comment.
We need to clean up debug logs everywhere
There was a problem hiding this comment.
everywhere in graph_build.cpp?
There was a problem hiding this comment.
Newly added ones should be removed at least
There was a problem hiding this comment.
If you replace ' with " you may use it as a .json file
|
Why should we have that big pull request (~6k lines of changes) without proper explanations for these changes? |
…embedded-dev-research/itlab_2023 into Semyon1104/BuildGraph_branching
9c89a34 to
2229aa7
Compare
| } | ||
| } | ||
|
|
||
| void build_graph(it_lab_ai::Tensor& input, it_lab_ai::Tensor& output, |
There was a problem hiding this comment.
please consider shortening this function, for example giant for (const auto& layer_data : model_data) parsing can be moved away to different function or even class.
main idea of build_graph is not parsing after all
| if (layers_[current_layer]->getName() == kSplit) { | ||
| for (const auto& tensor : outten_) { | ||
| for (size_t d = 0; d < tensor.get_shape().dims(); ++d) { | ||
| if (d < tensor.get_shape().dims() - 1) std::cout << ""; |
| 3.0f, 9.0f, 4.0f, 10.0f, 5.0f, 11.0f, | ||
| 12.0f, 18.0f, 13.0f, 19.0f, 14.0f, 20.0f, | ||
| 15.0f, 21.0f, 16.0f, 22.0f, 17.0f, 23.0f}; | ||
|
|
There was a problem hiding this comment.
why test of correctness of flatten layer was removed?
aobolensk
left a comment
There was a problem hiding this comment.
Let's proceed with what we have right now
The accuracy of alexnet_mnist remained the same at 98.01%
At the time of PR, the inference speed for one image is as follows: Googlenet - 1.5 seconds, Densenet - 2.8 seconds, Yolo - 7.6 seconds, Resnet - 14.6 seconds (after modifying the parallelism in the convolution layer, parallelization is performed not by batch size, but by output). It should also be noted that if the laptop is not charging, the time for each network increases by an average of 2 times.
I think I'll need to add parallelism for EWLayer, as it takes a long time to run in some places
The test dataset currently contains 50,000 images, and I think that before running accuracy, we should try to to optimize some parts further, both in the graph assembly and image preparation, and possibly within the layers. For example, there is no parallel implementation for ConvDepthVise and EWlayer, which immediately comes to mind. Alternatively, we can check the accuracy on smaller parts of the dataset.