Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1cc5d0a

Browse files
committed
upgrade to best downsample
1 parent59fa101 commit1cc5d0a

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

‎README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,4 +1285,14 @@ For detailed information on training the diffusion prior, please refer to the [d
12851285
}
12861286
```
12871287

1288+
```bibtex
1289+
@article{Sunkara2022NoMS,
1290+
title = {No More Strided Convolutions or Pooling: A New CNN Building Block for Low-Resolution Images and Small Objects},
1291+
author = {Raja Sunkara and Tie Luo},
1292+
journal = {ArXiv},
1293+
year = {2022},
1294+
volume = {abs/2208.03641}
1295+
}
1296+
```
1297+
12881298
*Creating noise from data is easy; creating data from noise is generative modeling.* - <ahref="https://arxiv.org/abs/2011.13456">Yang Song's paper</a>

‎dalle2_pytorch/dalle2_pytorch.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,9 +1479,14 @@ def init_conv_(self, conv):
14791479
defforward(self,x):
14801480
returnself.net(x)
14811481

1482-
defDownsample(dim,*,dim_out=None):
1482+
defDownsample(dim,dim_out=None):
1483+
# https://arxiv.org/abs/2208.03641 shows this is the most optimal way to downsample
1484+
# named SP-conv in the paper, but basically a pixel unshuffle
14831485
dim_out=default(dim_out,dim)
1484-
returnnn.Conv2d(dim,dim_out,4,2,1)
1486+
returnnn.Sequential(
1487+
Rearrange('b c (h s1) (w s2) -> b (c s1 s2) h w',s1=2,s2=2),
1488+
nn.Conv2d(dim*4,dim_out,1)
1489+
)
14851490

14861491
classWeightStandardizedConv2d(nn.Conv2d):
14871492
"""

‎dalle2_pytorch/trainer.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def __init__(
519519
clip=decoder.clip
520520
clip.to(precision_type)
521521

522-
decoder,train_dataloader,*optimizers=list(self.accelerator.prepare(decoder,dataloaders['train'],*optimizers))
522+
decoder,*optimizers=list(self.accelerator.prepare(decoder,*optimizers))
523523

524524
self.decoder=decoder
525525

‎dalle2_pytorch/version.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__='1.9.0'
1+
__version__='1.10.0'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp