Giter VIP home page Giter VIP logo

Comments (2)

majianjia avatar majianjia commented on June 6, 2024

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.

parai avatar parai commented on June 6, 2024

understood, thanks your reply.

from nnom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.