You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: perfusion_pytorch/perfusion.py
+37-19Lines changed: 37 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -126,20 +126,22 @@ def __init__(
126
126
key_or_values_proj: nn.Linear,
127
127
*,
128
128
num_concepts: int=1,
129
-
C: Tensor, # covariance of input, precomputed from 100K laion text
129
+
C: Tensor, # covariance of input, precomputed from 100K laion text
130
130
text_seq_len: int=77,
131
131
is_key_proj: bool=False,
132
132
input_decay=0.99,
133
133
train_beta=0.75,
134
134
train_temperature=0.1,
135
-
eval_beta=0.70, # in paper, specified a range (0.6 - 0.75) for local-key lock, and (0.4 -0.6) for global-key lock
135
+
eval_beta=0.70, # in paper, specified a range (0.6 - 0.75) for local-key lock, and (0.4 -0.6) for global-key lock
136
136
eval_temperature=0.15,
137
-
frac_gradient_concept_embed=0.1# they use a slower learning rate for the embed - this can be achieved by a trick to reduce the gradients going backwards through an operation
137
+
frac_gradient_concept_embed=0.1, # they use a slower learning rate for the embed - this can be achieved by a trick to reduce the gradients going backwards through an operation
138
+
multi_concepts_use_cholesky=False# use an approximated technique without Cholesky root for multiple concepts
138
139
):
139
140
super().__init__()
140
141
assertnotexists(key_or_values_proj.bias), 'key value projection in attention should not have bias'
0 commit comments