Comments (6)
Hi @QWTforGithub , the x_0 in the paper is a one-hot row vector. When x_0 multiplies with Q_t in the formula, in the code, it effectively acts as indexing from the corresponding position in Q_t, I guess that's how it works.
I've also been following d3pm recently, feel free to reach out for discussion anytime.
from d3pm.
Hi @QWTforGithub , the x_0 in the paper is a one-hot row vector. When x_0 multiplies with Q_t in the formula, in the code, it effectively acts as indexing from the corresponding position in Q_t, I guess that's how it works.
I've also been following d3pm recently, feel free to reach out for discussion anytime.
Thank you for your reply. Now I have another question about "vb loss":
**def vb(self, dist1, dist2):
# flatten dist1 and dist2
dist1 = dist1.flatten(start_dim=0, end_dim=-2)
dist2 = dist2.flatten(start_dim=0, end_dim=-2)
out = torch.softmax(dist1 + self.eps, dim=-1) * (
torch.log_softmax(dist1 + self.eps, dim=-1)
- torch.log_softmax(dist2 + self.eps, dim=-1)
)
return out.sum(dim=-1).mean()**
My understanding of "vb loss" is "Variational Bayes Loss", that is, an MSE loss + a KL divergence. (torch.log_softmax(dist1 + self.eps, dim=-1) - torch.log_softmax(dist2 + self.eps, dim=-1))" can be considered as the difference of two posterior distributions (a KL divergence). But, why should What about multiplying by "torch.softmax(dist1 + self.eps, dim=-1)"? Looking forward to your reply.
from d3pm.
@QWTforGithub I feel that this should just be a simple calculation of the KL divergence loss.
I feel that the step 'torch.softmax(dist1 + self.eps, dim=-1)' is just converting dist1 from logits to probabilities.
from d3pm.
@QWTforGithub I feel that this should just be a simple calculation of the KL divergence loss.
L(ypred,ytrue)=ytrue⋅logytrueypred=ytrue⋅(logytrue−logypred)
I feel that the step 'torch.softmax(dist1 + self.eps, dim=-1)' is just converting dist1 from logits to probabilities.
Thank you very much for your answer! May I ask you have tried to derive the formula in D3PM (Eq 3)? Why does the posterior distribution q(xt-1|xt,x0) get the form of Eq3? This transition probability p:
But not:
How is Eq3 derived?
from d3pm.
@QWTforGithub Sorry, I feel it's a bit inappropriate to discuss here. I haven't found your email yet. If you don't mind, we can discuss on WeChat or elsewhere. Here's my email: [email protected].
from d3pm.
@QWTforGithub Sorry, I feel it's a bit inappropriate to discuss here. I haven't found your email yet. If you don't mind, we can discuss on WeChat or elsewhere. Here's my email: [email protected].
Thank you very much. I have sent a message to your email. I hope to communicate with you further.
from d3pm.
Related Issues (4)
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 d3pm.