Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time embedding use cat[cos, sin] #78

Open
shy19960518 opened this issue Mar 28, 2024 · 0 comments
Open

time embedding use cat[cos, sin] #78

shy19960518 opened this issue Mar 28, 2024 · 0 comments

Comments

@shy19960518
Copy link

Here is the time embedding code in the TimestepEmbedder() class in model.py ## at the top of Dit class
embedding = torch.cat([torch.cos(args), torch.sin(args)], dim=-1)

It seems to connect two tensors in the dimension of half: [cos0, cos1,..., cos(half), sin0, sin1, ..., sin(half)]
However, the formula is alternately inserted: [cos0, sin0, cos1, sin1, ..., cos(half), sin(half)]
Experiments showed that the model works well in A. But I wonder that will this have any impact? Or In what kind of task it will lead to hazard?

Another question is why this part used an MLP for another representation for t? I mean, the representation/understanding could be processed in Transformer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant