Skip to content

Commit 04b6feb

Browse files
committed
add additional stabilization technique, looking at ruDALL-E results
1 parent 1dcf6c3 commit 04b6feb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

dalle_pytorch/dalle_pytorch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,10 @@ def forward(
557557
seq_len -= 1
558558
tokens = tokens[:, :-1]
559559

560+
if self.stable:
561+
alpha = 0.1
562+
tokens = tokens * alpha + tokens.detach() * (1 - alpha)
563+
560564
out = self.transformer(tokens)
561565

562566
if self.stable:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name = 'dalle-pytorch',
55
packages = find_packages(),
66
include_package_data = True,
7-
version = '1.1.0',
7+
version = '1.1.1',
88
license='MIT',
99
description = 'DALL-E - Pytorch',
1010
author = 'Phil Wang',

0 commit comments

Comments
 (0)