Skip to content

Commit

Permalink
Merge pull request #68 from francesco-vaselli/main
Browse files Browse the repository at this point in the history
add padding of t in TargetConditionalFlowMatcher (fix bug)
  • Loading branch information
kilianFatras authored Nov 10, 2023
2 parents a7a6d83 + 5b3a22e commit 21cd0c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchcfm/conditional_flow_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def compute_mu_t(self, x0, x1, t):
[2] Flow Matching for Generative Modelling, ICLR, Lipman et al.
"""
del x0
t = pad_t_like_x(t, x1)
return t * x1

def compute_sigma_t(self, t):
Expand Down Expand Up @@ -369,6 +370,7 @@ def compute_conditional_flow(self, x0, x1, t, xt):
[1] Flow Matching for Generative Modelling, ICLR, Lipman et al.
"""
del x0
t = pad_t_like_x(t, x1)
return (x1 - (1 - self.sigma) * xt) / (1 - (1 - self.sigma) * t)


Expand Down

0 comments on commit 21cd0c8

Please sign in to comment.