Coder Social home page Coder Social logo

Comments (4)

csong27 avatar csong27 commented on September 27, 2024

Because he needs to pad sentence with zero vectors. See this function: get_idx_from_sent

from cnn_sentence.

Imane0 avatar Imane0 commented on September 27, 2024

Why padding the beginning of all sentences with the same number of zeros (filter_h=5 in function get_idx_from_sent) ? and how this number is set ?
I guess this is related to the maximum region size / height used ?
Another question is why function 'get_idx_from_sent' adding 0 until a length of max_l + 2*pad is reached where pad = filter_h - 1 ? Why not until max_l + pad only ?

from cnn_sentence.

csong27 avatar csong27 commented on September 27, 2024

Each sentence has different number of words and thus the inputs to the CNN would have different sizes. Therefore, padding is needed to ensure all inputs have the same size.

from cnn_sentence.

Imane0 avatar Imane0 commented on September 27, 2024

I got that. I'm asking why extending the length of all sentences to max_l + 2*pad and not just to max_l ?

from cnn_sentence.

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.