Answers.Body: <p>The most common way people deal with inputs of varying length is <strong>padding</strong>.</p>
  <p>You first define the desired sequence length, i.e. the input length you want your model to have. Then any sequences with a shorter length than this are padded either with zeros or with special characters so that they reach the desired length. If an input is larger than your desired length, usually you'd split it into multiple inputs.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-03-28T10:37:25.467Z
Answers.LastActivityDate: 2021-12-17T00:18:05.667Z
Answers.LastEditDate: 2021-12-17T00:18:05.667Z
Answers.UserDisplayName: Djib2011
Body: <p>I am a very beginner in the field of AI. I am basically a Pharma Professional without much coding experience. I use GUI-based tools for the neural network.</p>
  <p>I am trying to develop an ANN that receives as input a protein sequence and produces as output a drug molecule. Drug molecules can be represented as fixed-length binary (0-1). This length is 881 bits.</p>
  <p>However, I do not know how to transform protein sequences of variable length into a fixed-length binary representation.</p>
  <p>So, how should I deal with variable-length inputs for a neural network? What is the best way?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-03-28T13:13:17.710Z
Comments.Text: Hi and welcome to AI! Maybe you should explain more in detail how the protein sequences look like, and maybe you should provide examples of variable-length protein sequences.
Comments.UserDisplayName: nbro
Tags: <neural-networks><machine-learning><data-preprocessing>
Title: How should I deal with variable-length inputs for neural networks?
UserDisplayName: Swayamprakash Patel
ThreadText: # How should I deal with variable-length inputs for neural networks?
  
  (Asked by: username_0 on 2020-03-28)
  
  I am a very beginner in the field of AI. I am basically a Pharma Professional without much coding experience. I use GUI-based tools for the neural network.
  
  I am trying to develop an ANN that receives as input a protein sequence and produces as output a drug molecule. Drug molecules can be represented as fixed-length binary (0-1). This length is 881 bits.
  
  However, I do not know how to transform protein sequences of variable length into a fixed-length binary representation.
  
  So, how should I deal with variable-length inputs for a neural network? What is the best way?
  
  **Tags:** neural-networks, machine-learning, data-preprocessing
  
  > **Comments:**
  > **username_1**: Hi and welcome to AI! Maybe you should explain more in detail how the protein sequences look like, and maybe you should provide examples of variable-length protein sequences.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-03-28. Score: 4
  
  The most common way people deal with inputs of varying length is **padding**.
  
  You first define the desired sequence length, i.e. the input length you want your model to have. Then any sequences with a shorter length than this are padded either with zeros or with special characters so that they reach the desired length. If an input is larger than your desired length, usually you'd split it into multiple inputs.
  
  
  ---
  
  