Skip to content

Commit 1f59e7e

Browse files
committed
it does not work
1 parent dc6ba3d commit 1f59e7e

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,3 @@ trainer()
142142
url = {https://api.semanticscholar.org/CorpusID:270878436}
143143
}
144144
```
145-
146-
```bibtex
147-
@inproceedings{Yao2024FasterDiTTF,
148-
title = {FasterDiT: Towards Faster Diffusion Transformers Training without Architecture Modification},
149-
author = {Jingfeng Yao and Wang Cheng and Wenyu Liu and Xinggang Wang},
150-
year = {2024},
151-
url = {https://api.semanticscholar.org/CorpusID:273346237}
152-
}
153-
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rectified-flow-pytorch"
3-
version = "0.1.11"
3+
version = "0.1.12"
44
description = "Rectified Flow in Pytorch"
55
authors = [
66
{ name = "Phil Wang", email = "[email protected]" }

rectified_flow_pytorch/rectified_flow.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,6 @@ class MSELoss(Module):
116116
def forward(self, pred, target, **kwargs):
117117
return F.mse_loss(pred, target)
118118

119-
class MSEAndDirectionLoss(Module):
120-
"""
121-
Figure 7 - https://arxiv.org/abs/2410.10356
122-
"""
123-
124-
def __init__(self, cosine_sim_dim: int = 1):
125-
super().__init__()
126-
assert cosine_sim_dim > 0, 'cannot be batch dimension'
127-
self.cosine_sim_dim = cosine_sim_dim
128-
129-
def forward(self, pred, target, **kwargs):
130-
mse_loss = F.mse_loss(pred, target)
131-
132-
direction_loss = (1. - F.cosine_similarity(pred, target, dim = self.cosine_sim_dim)).mean()
133-
134-
return mse_loss + direction_loss
135-
136119
# loss breakdown
137120

138121
LossBreakdown = namedtuple('LossBreakdown', ['total', 'main', 'data_match', 'velocity_match'])
@@ -152,7 +135,6 @@ def __init__(
152135
predict: Literal['flow', 'noise'] = 'flow',
153136
loss_fn: Literal[
154137
'mse',
155-
'mse_and_direction',
156138
'pseudo_huber',
157139
'pseudo_huber_with_lpips'
158140
] | Module = 'mse',
@@ -197,9 +179,6 @@ def __init__(
197179
if loss_fn == 'mse':
198180
loss_fn = MSELoss()
199181

200-
elif loss_fn == 'mse_and_direction':
201-
loss_fn = MSEAndDirectionLoss(**loss_fn_kwargs)
202-
203182
elif loss_fn == 'pseudo_huber':
204183
assert predict == 'flow'
205184

0 commit comments

Comments
 (0)