How are neural networks used when the number of inputs could be variable?

后端 未结 6 465
一生所求
一生所求 2020-12-12 21:48

All the examples I have seen of neural networks are for a fixed set of inputs which works well for images and fixed length data. How do you deal with variable length data s

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 22:29

    i'm not entirely sure, but I'd say, use the maximum number of inputs (e.g. for words, lets say no word will be longer than 45 characters (longest word found in a dictionary according to wikipedia), and if a shorter word is encountered, set the other inputs to a whitespace character.

    Or with binary data, set it to 0. the only problem with this approach is if an input filled with whitespace characters/zeros/whatever collides with a valid full length input (not so much a problem with words as it is with numbers).

提交回复
热议问题