mmf icon indicating copy to clipboard operation
mmf copied to clipboard

Adding custom embedding into model

Open nan1104 opened this issue 3 years ago • 2 comments

❓ Questions and Help

I am using m4c model, in mmf, word embedding for ocr tokens are loaded by fasttext model during dataset process. However, I want to use custom embedding for ocr tokens (include corresponding vocab and load pretrained embedding) and add this embedding into model and train the embedding together. How can I achieve this?

nan1104 avatar Jul 08 '21 07:07 nan1104

Hi @nan1104, thanks for using mmf,

Feel free to subclass our m4c model to achieve the functionality you need. MMF is designed to be customizable and composable. Make sure that you register the subclass of the model, so that in your script to launch training, you can specify the model as subclass name.

hackgoofer avatar Jul 08 '21 21:07 hackgoofer

Hello, as @nan1104 , I want to add a module (composed by vocab and pretrained embeddings) to the m4c model, as the fastext is implemented.

Sorry for bothering you @ytsheng, but your answer didn't respond to the question. What are the files that one is suppose to modify to achive this?

Thanks, Emanuele

emanuelevivoli avatar Apr 08 '22 10:04 emanuelevivoli