Giter VIP home page Giter VIP logo

Comments (5)

koenhelwegen avatar koenhelwegen commented on July 24, 2024 3

After trying to consistently use this in my own code, I am less sure if we should adopt explicit layer naming because I found it did make my code somewhat less readable. To summarize:

Pros:

  • Makes it much more intuitive to use models as building blocks in complicated structures (e.g. encoder/decoder nets, student/teacher for KD)
  • Makes model summary more readable

Cons:

  • Makes code less readable: adds an additional argument to every 'module' function (resnet_block() etc.) and occasionally forces the use of Lambda functions.

Personally, I think readable code strongly outweighs a readable model summary, but the building-block argument is probably decisive here. I would like to adopt a consistent policy for all of zoo. Please share any objections to the above reasoning; otherwise let's proceed with adding this for all models.

from zoo.

timdebruin avatar timdebruin commented on July 24, 2024 2

I am still very much in favor of this, as I am still running into cases (knowledge distillation) that need this. I had forgotten I was assigned to this. I am a little busy at the moment but since I need this for KD I will make a PR at some point to the models in zoo that do not have this.

from zoo.

timdebruin avatar timdebruin commented on July 24, 2024

As an example of the kind of confusion this might prevent:

The zoo example code that deals with exactly this point uses get layer by name:

outputs=base_model.get_layer("average_pooling2d_8").output

The example code fragment does not actually work in isolation since the the network only has 3 average_pooling2d layers. It does work when following the examples one by one in the same session as this is the third example with the same network, so by creating the previous 2 there are enough average pooling layers to get to number 8.

from zoo.

jneeven avatar jneeven commented on July 24, 2024

I thought this would be the standard from now on, but I see QuickNet unfortunately still has layer names like "add_3" and "quant_conv2d_5". Do we or do we not enforce this policy?

from zoo.

leonoverweel avatar leonoverweel commented on July 24, 2024

Models which currently have explicit layers names, so no auto-generated names, based on the model summaries embedded in the docs:

  • sota
    • QuickNet
    • QuickNetLarge
    • QuickNetXL
  • literature
    • BinaryAlexNet
    • BiRealNet
    • BinaryResNetE18
    • BinaryDenseNet28
    • BinaryDenseNet37
    • BinaryDenseNet37Dilated
    • BinaryDenseNet45
    • DoReFaNet
    • MeliusNet22
    • RealToBinaryNet
    • XNORNet

from zoo.

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.