Answers.Body: <p>I think if you want to resize and reduce your matrix size, you can use one of the dimension reduction techniques.</p>
  <p><a href="https://www.analyticsvidhya.com/blog/2018/08/dimensionality-reduction-techniques-python/" rel="nofollow noreferrer">Here</a> there is a link that may be helpful to you.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-05T09:14:13.880Z
Answers.Text: thank you for answering. By doing dim reduction, will I lose info?
Answers.UserDisplayName: OK 400
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-05T11:39:17.303Z
Answers.Text: techniques are different and in that link, it is written for every technique that is lossless or lossy decomposition.
Answers.UserDisplayName: Seyed Moein Ayyoubzadeh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-05T06:03:30.980Z
Answers.LastActivityDate: 2021-12-05T06:03:30.980Z
Answers.UserDisplayName: Seyed Moein Ayyoubzadeh
Body: <p>I have a <code>(5, 128, 768)</code> matrix, that is, I have 5 embedding spaces of shape <code>(128, 768)</code>. Since they all keep a relation, and for the sake of my model, I need to combine them into a unique output: <code>(1, 128, 768*5)</code>. If I just concat them all along <code>axis=-1</code>, will I be losing some info?</p>
  <p>Making that concatenation is the only way I can think of solving this. Is there any better option?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-12-05T12:41:12.170Z
Comments.Text: I don't fully understand your problem. You have 5 embedding spaces of shape `(128, 768)`, which you store together in the tensor `(5, 128, 768)`. Now, my question is, why do you want to convert the tensor of shape `(5, 128, 768)` to `(1, 128, 768*5)`? You don't explain this.
Comments.UserDisplayName: nbro
Tags: <deep-learning><embeddings>
Title: Best way to resize 3d to 2d matrix
UserDisplayName: OK 400
ThreadText: # Best way to resize 3d to 2d matrix
  
  (Asked by: username_0 on 2021-12-05)
  
  I have a `(5, 128, 768)` matrix, that is, I have 5 embedding spaces of shape `(128, 768)`. Since they all keep a relation, and for the sake of my model, I need to combine them into a unique output: `(1, 128, 768*5)`. If I just concat them all along `axis=-1`, will I be losing some info?
  
  Making that concatenation is the only way I can think of solving this. Is there any better option?
  
  **Tags:** deep-learning, embeddings
  > **Comments:**
  > **username_1**: I don't fully understand your problem. You have 5 embedding spaces of shape `(128, 768)`, which you store together in the tensor `(5, 128, 768)`. Now, my question is, why do you want to convert the tensor of shape `(5, 128, 768)` to `(1, 128, 768*5)`? You don't explain this.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-12-05. Score: 0 | Accepted answer
  
  I think if you want to resize and reduce your matrix size, you can use one of the dimension reduction techniques.
  
  [Here](https://www.analyticsvidhya.com/blog/2018/08/dimensionality-reduction-techniques-python/) there is a link that may be helpful to you.
  
  > **Comments:**
  > **username_0**: thank you for answering. By doing dim reduction, will I lose info?  
  > **username_2**: techniques are different and in that link, it is written for every technique that is lossless or lossy decomposition.  
  
  ---
  
  