cloneofsimo / d3pm Goto Github PK
View Code? Open in Web Editor NEWMinimal Implementation of a D3PM in pytorch
Home Page: https://proceedings.neurips.cc/paper/2021/hash/958c530554f78bcd8e97125b70e6973d-Abstract.html
Minimal Implementation of a D3PM in pytorch
Home Page: https://proceedings.neurips.cc/paper/2021/hash/958c530554f78bcd8e97125b70e6973d-Abstract.html
Hello,
I hope this message finds you well. I have a question regarding the implementation of the loss function in D3PM. Specifically, in the forward method, there is a line of code located here:
predicted_x0_logits = self.model_predict(x, t, cond)
I was wondering why it isn't self.model_predict(x_t, t, cond)
instead, predicting x_0 through x_t?
Thank you for your attention to this matter.
Could you please share the code for Absorbing State Forward Diffusion, where all states moved to [MASKED] state eventually?
Thank you very much for posting the pytorch implementation of D3PM. I have questions about the following function:
*def _at(self, a, t, x):
# t is 1-d, x is integer value of 0 to num_classes - 1
bs = t.shape[0]
t = t.reshape((bs, [1] * (x.dim() - 1)))
# out[i, j, k, l, m] = a[t[i, j, k, l], x[i, j, k, l], m]
return a[t - 1, x, :]
This function seems to convert x0 to xt based on accumulated Qt. However, in the original paper, the conversion of x0 to xt is done by Qt multiplied by x0 (Eq 3). But this function does not seem to express this meaning. This is just selecting some values from Qt, and there no exist any calculation relationship between x0 and Qt (in the original D3PM code, the conversion from x0 to xt is also achieved in this way). At the same time, I also noticed that the xt obtained in this way was directly sent to the network. What is the way to convert from x0 to xt? Or is there something wrong with my understanding of this code? Looking forward to your reply.
Hi Simo,
Thank you very much for your work. I have a question about one part: why is it t-2
here?
qmats2 = self.q_mats[t - 2].to(dtype=softmaxed.dtype)
The hybrid loss from eq. 5 is defined (and also accordingly implemented in the official implementation) as:
losses = vb_losses + self.hybrid_coeff * ce_losses
Here it is implemented as follows though:
Line 294 in 3ceb637
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.