Skip to content

Commit 463c918

Browse files
committed
only during training do they exponentially smooth
1 parent 3fe1968 commit 463c918

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

perfusion_pytorch/perfusion.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ def forward(
103103
if self.is_key_proj:
104104
text_enc_with_superclass_output = text_enc_with_superclass_output.detach()
105105

106-
online_estimated_concept_enc = decay * superclass_text_enc + (1. - decay) * concept_text_enc
106+
# only during training do they exponentially smooth
107+
108+
if self.training:
109+
online_estimated_concept_enc = decay * superclass_text_enc + (1. - decay) * concept_text_enc
110+
else:
111+
online_estimated_concept_enc = concept_text_enc
107112

108113
# make it easier to match with paper
109114

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setup(
44
name = 'perfusion-pytorch',
55
packages = find_packages(exclude=[]),
6-
version = '0.0.5',
6+
version = '0.0.6',
77
license='MIT',
88
description = 'Perfusion - Pytorch',
99
author = 'Phil Wang',

0 commit comments

Comments
 (0)