Answers.Body: <p>If you're mapping from a higher dimension to a smaller dimension, you're almost always going to be losing data. The question is how to decide which data you want to keep.</p>
  <p>This all is highly domain specific.</p>
  <p>I would start with one modality: how should you compress that into a reasonably sized 1D vector? Maybe look for past work that deals with similar dimensions of data: e.g., for video classification you might also want to convert a series of images (n x c x w x h) to a 1D vector that gets fed into a linear classifier. <a href="https://arxiv.org/pdf/1609.06782" rel="nofollow noreferrer">This textbook chapter</a> seems particularly useful. One architecture they propose is a 3D CNN.</p>
  <p>To incorporate multiple modalities, you'll probably have to figure out when to concatenate your data. E.g., you could encode each modality separately, then concat at the very end or concatenate at the very beginning. You should also look at past work for this (e.g., maybe video + audio classification?).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-01-19T01:04:48.843Z
Answers.LastActivityDate: 2024-01-19T01:04:48.843Z
Answers.UserDisplayName: Alexander Wan
Body: <p>I am a newbie in AI and playing with some computer vision algorithms.</p>
  <p>I have three tensors with different sizes. Noise augmentation levels tensor with size (N, C, H, W), diffusion timestep tensor of size (N, H) and pooled pose embeddings of size (N, C, H, W). I need to sum these tensors so that the 1D embedding result can be fed to FiLM layer.</p>
  <p>How can I apply the summation without losing data?</p>
  <p>Thank you!</p>
  
Tags: <neural-networks><python><pytorch>
Title: How to Create a 1D Embedding from Tensors of Varying Sizes?
UserDisplayName: Pooya Kamranjam
ThreadText: # How to Create a 1D Embedding from Tensors of Varying Sizes?
  
  (Asked by: username_0 on 2024-01-18)
  
  I am a newbie in AI and playing with some computer vision algorithms.
  
  I have three tensors with different sizes. Noise augmentation levels tensor with size (N, C, H, W), diffusion timestep tensor of size (N, H) and pooled pose embeddings of size (N, C, H, W). I need to sum these tensors so that the 1D embedding result can be fed to FiLM layer.
  
  How can I apply the summation without losing data?
  
  Thank you!
  
  **Tags:** neural-networks, python, pytorch
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-01-19. Score: 1
  
  If you're mapping from a higher dimension to a smaller dimension, you're almost always going to be losing data. The question is how to decide which data you want to keep.
  
  This all is highly domain specific.
  
  I would start with one modality: how should you compress that into a reasonably sized 1D vector? Maybe look for past work that deals with similar dimensions of data: e.g., for video classification you might also want to convert a series of images (n x c x w x h) to a 1D vector that gets fed into a linear classifier. [This textbook chapter](https://arxiv.org/pdf/1609.06782) seems particularly useful. One architecture they propose is a 3D CNN.
  
  To incorporate multiple modalities, you'll probably have to figure out when to concatenate your data. E.g., you could encode each modality separately, then concat at the very end or concatenate at the very beginning. You should also look at past work for this (e.g., maybe video + audio classification?).
  
  
  ---
  
  