Comments (2)
Hi parai,
Thanks for the suggestion,
I was trying to make NNoM static similar to your idea, and I did try to write it as a static graph at the very beginning, but I gave up.
- If I make it like the code you proposed, the buffer size must be calculated by the user.
- The layer list is not easy to fit different types of layer (dense, conv, relu they all have different parameters, adding new types of layer will affact the old codes).
Those dirty jobs are the ones I tryed hard to avoid to do by myself.
Other than that, the current NNoM can do all the tedious works for you, such as manage the memory, figure out the output shapes in between layers, find out the running order for layers...
The performance impact by NNoM is quite small, memories are pre-allocated and reused by different layers, it takes no time while you run the model.
The running is already as simple as while(layer.next());
takes less than 1us to switch between layers.
It records the order in a shortcut list, and use the list to run the model.
If you put the NNoM code and Keras code side-by-side, they will looks very similar. If you want to fine tune your Keras model by changing a few parameters, you can simply change the parameters in NNoM side at the same position.
Static graphs are great for reducing memory footprint. But they should come with better conversion tools.
If a script can convert your model into C files using CMSIS-NN like they are doing with CMSIS-NN examples, NNoM makes no sense.
However, the problem is writing and modifying those scripts to fit your own built model is already a tedious job. Especially when your model has complex structures such as DenseNet.
I do appreciate your idea,
In one hand, NNoM was designed for fast test on complex model, but the extra memory that it taken is not necessary for the deployment. After compiling, many memory are never used such as the Hook which store the links in between layers. I am thinking of an API to free these kind of memory.
In other hand, NNoM can be easily change to dynamic graph framework in the future if these links are researve.
Just an idea,
Thanks again,
Jianjia
from nnom.
understood, thanks your reply.
from nnom.
Related Issues (20)
- 谁弄一个英文字母识别出来试试 HOT 1
- 当前框架能否支持slice HOT 2
- 关于Conv2D的支持问题 HOT 1
- Any plans for adding support for PyTorch and PaddlePaddle AI frameworks? HOT 1
- About used time? HOT 1
- 关于CNN运行速度的问题 HOT 1
- Incosistent Accuracy Between Python and C Implementation HOT 2
- 关于记忆性 HOT 4
- 报错 File "ptq_ns/nnom-master/scripts/nnom.py", line 1019, in generate_model inX += ' ,layer[%d]' % (LI[inp][0]) KeyError: 'tf.__operators__.getitem_5'
- about reshape HOT 3
- 使用了per channel量化和kld量化方法后,出现了多次推理结果不一致的问题
- 关于输出维度的问题 HOT 4
- nnom静态内存支持如何打开? HOT 6
- main_pc.c中的test_x.txt和text_y.txt如何制作?
- 关于识别几秒时长的语音 HOT 3
- inhomogeneous shape after 1 dimensions
- keyword_spotting中的main_pc.c中的test_x.txt和text_y.txt如何制作?
- nothing
- 关于使用DW_Conv2D与Conv2D的移植后使用耗时的问题 HOT 1
- 使用#define NNOM_USING_CMSIS_NN 的错误。 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnom.