You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/06/27 13:37:10 UTC

[GitHub] MandarGogate opened a new issue #11420: Shared Embedding layer with different input lengths and same vocabulary

MandarGogate opened a new issue #11420: Shared Embedding layer with different input lengths and same vocabulary
URL: https://github.com/apache/incubator-mxnet/issues/11420
 
 
   I'm trying to build a classification model with name and description as features. I tried to train the model with a separate embedding layer but since these features share most of the words, I am wondering if there is any way to have a shared embedding layer with different input size. This will reduce significantly reduce the number of parameters in the network.
   
   If I initialize two embedding layers with same weights as below would the weights be same after I train the network?
   
   ```python
   weight = mx.sym.random.uniform(shape=(10000,50))
   embed = mx.symbol.Embedding(data=inp1, name="embed1”, output_dim=50, input_dim=10000, weight=weight)
   embed_2 = mx.symbol.Embedding(data=inp2, name="embed1”, output_dim=50, input_dim=10000, weight=weight)
   ```
   
   I guess a workaround would be to simply force them to the same length, but this is not ideal since name is 5 times shorter than the description.
   
   Any other ideas?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services