Comments (1)
Hi @yzhang511 ,
Thanks for your interest in 4M! I believe there is some confusion due to the double meaning of the word "mask" in our code and in the literature.
The decoder_mask
that you're referring to is an invalid / ignore mask, indicating which tokens should be entirely ignored by the decoder when the number of valid tokens is less than the decoder sequence length (akin to padding tokens in LMs). This is also why that same operation is performed in the encoder, to remove invalid tokens there.
If you're looking for the "T5 / MAE" token masking implementation, the bulk of it is defined in masking.py as part of data loading, where we define:
- Which tokens to give to the encoder
- Which tokens to give to the decoder
- Which tokens to discard altogether (i.e., which are "invalid")
Then, in forward_mask_encoder()
and forward_mask_decoder()
of the forward pass, we gather the valid tokens out of all concatenated tokens for the encoder / decoder respectively such that the valid tokens are at the beginning of the sequence, and the invalid ones at the end. The function that sets the decoder tokens to 0 for image-like modalities (i.e. BERT/MAE masking) is in the cat_decoder_tensors()
function here.
Hope this makes everything clearer. If you have any further questions, please don't hesitate to ask.
Best, David
from ml-4m.
Related Issues (18)
- Fine-tune using LoRA
- What are the minimum requirements to run an inference? HOT 1
- Training details of RGB tokenizer
- [Errno 2] No such file or directory: './fourm/utils/hmr2_utils/model_cfg.pkl' HOT 1
- Is it possible to prompt 4m
- CUDA? Are you kidding me?
- Examples of non-generative usage (and some additional discussion) HOT 11
- Input masks for generation - Potential small bug.
- Depth tokenizer
- How to use RGB DiVAE tokenizer? HOT 3
- Typo for tokenizer_path arg
- Object Detection with Caption HOT 2
- Example of generating image pixels from ImageBind modality HOT 1
- VRAM Requirements and Multi-GPU Inference Support
- how to convert the trained FM pth model file to safetensors format?
- CLIPScore moved in latest torchmetrics v1.4.0.post0
- Whatβs the best way to use Color palette and another image to condition outputs? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ml-4m.