File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -145,10 +145,10 @@ def get_representation(self, x):
145
145
assert hidden is not None , f'hidden layer { self .layer } never emitted an output'
146
146
return hidden
147
147
148
- def forward (self , x , return_embedding = False ):
148
+ def forward (self , x , return_projection = True ):
149
149
representation = self .get_representation (x )
150
150
151
- if return_embedding :
151
+ if not return_projection :
152
152
return representation
153
153
154
154
projector = self ._get_projector (representation )
@@ -225,9 +225,14 @@ def update_moving_average(self):
225
225
assert self .target_encoder is not None , 'target encoder has not been created yet'
226
226
update_moving_average (self .target_ema_updater , self .target_encoder , self .online_encoder )
227
227
228
- def forward (self , x , return_embedding = False ):
228
+ def forward (
229
+ self ,
230
+ x ,
231
+ return_embedding = False ,
232
+ return_projection = True
233
+ ):
229
234
if return_embedding :
230
- return self .online_encoder (x , True )
235
+ return self .online_encoder (x , return_projection = return_projection )
231
236
232
237
image_one , image_two = self .augment1 (x ), self .augment2 (x )
233
238
Original file line number Diff line number Diff line change 3
3
setup (
4
4
name = 'byol-pytorch' ,
5
5
packages = find_packages (exclude = ['examples' ]),
6
- version = '0.5.5 ' ,
6
+ version = '0.5.6 ' ,
7
7
license = 'MIT' ,
8
8
description = 'Self-supervised contrastive learning made simple' ,
9
9
author = 'Phil Wang' ,
You can’t perform that action at this time.
0 commit comments