Skip to content

Commit

Permalink
fix: changed function name in monster diffusion
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulLowenstrom authored and samedii committed Aug 1, 2022
1 parent 767e6e3 commit e50ac20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions perceptor/models/monster_diffusion/monster_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def schedule_ts(n_steps):
@staticmethod
def evaluation_ts():
n_steps = 1000
schedule_ts = KDiffusion.schedule_ts(n_steps)
schedule_ts = MonsterDiffusion.schedule_ts(n_steps)
return torch.cat(
[
schedule_ts,
KDiffusion.reversed_ts(schedule_ts, n_steps),
MonsterDiffusion.reversed_ts(schedule_ts, n_steps),
]
).unique()

Expand All @@ -71,7 +71,7 @@ def alphas(ts):
def random_noise(size):
return standardize.decode(
torch.randn(size, *settings.INPUT_SHAPE)
* KDiffusion.sigmas(KDiffusion.schedule_ts(100)[:1])
* MonsterDiffusion.sigmas(MonsterDiffusion.schedule_ts(100)[:1])
)

@staticmethod
Expand All @@ -89,7 +89,7 @@ def diffuse(

assert x0.shape == noise.shape

return standardize.decode(x0 + noise * KDiffusion.sigmas(ts))
return standardize.decode(x0 + noise * MonsterDiffusion.sigmas(ts))

def c_skip(self, ts):
return diffusion.sigma_data**2 / (
Expand Down Expand Up @@ -191,7 +191,7 @@ def gamma(ts, n_steps):

@staticmethod
def reversed_ts(ts, n_steps):
return ts + KDiffusion.gamma(ts, n_steps) * ts
return ts + MonsterDiffusion.gamma(ts, n_steps) * ts

def inject_noise(self, diffused_images, ts, reversed_ts):
diffused_xs = standardize.encode(diffused_images).to(self.device)
Expand Down

0 comments on commit e50ac20

Please sign in to comment.