projects
/
pytorch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f27d608
)
Update.
author
Francois Fleuret
<francois@fleuret.org>
Fri, 12 Aug 2022 08:01:40 +0000
(10:01 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Fri, 12 Aug 2022 08:01:40 +0000
(10:01 +0200)
minidiffusion.py
patch
|
blob
|
history
diff --git
a/minidiffusion.py
b/minidiffusion.py
index
037ef11
..
6855752
100755
(executable)
--- a/
minidiffusion.py
+++ b/
minidiffusion.py
@@
-74,7
+74,8
@@
x = torch.randn(10000, 1)
for t in range(T-1, -1, -1):
z = torch.zeros(x.size()) if t == 0 else torch.randn(x.size())
input = torch.cat((x, torch.ones(x.size(0), 1) * 2 * t / T - 1), 1)
- x = 1 / alpha[t].sqrt() * (x - (1 - alpha[t])/(1 - alpha_bar[t]).sqrt() * model(input)) + sigma[t] * z
+ x = 1 / alpha[t].sqrt() * (x - (1 - alpha[t])/(1 - alpha_bar[t]).sqrt() * model(input)) \
+ + sigma[t] * z
######################################################################
# Plot