This commit is contained in:
Glenn Jocher 2019-08-25 02:03:52 +02:00
parent 991362df57
commit 14e67196ea
1 changed files with 3 additions and 3 deletions

View File

@ -78,11 +78,11 @@ def create_modules(module_defs, img_size, arc):
# Initialize preceding Conv2d() bias (https://arxiv.org/pdf/1708.02002.pdf section 3.3) # Initialize preceding Conv2d() bias (https://arxiv.org/pdf/1708.02002.pdf section 3.3)
try: try:
if arc == 'default': if arc == 'default':
b = [-5.0, -4.0] # obj, cls b = [-5, -4] # obj, cls
elif arc == 'uCE': # unified CE (1 background + 80 classes) elif arc == 'uCE': # unified CE (1 background + 80 classes)
b = [3.0, -4.0] # obj, cls b = [7, 0] # obj, cls
elif arc == 'uBCE': # unified BCE (80 classes) elif arc == 'uBCE': # unified BCE (80 classes)
b = [-5.0, -4.0] # obj, cls b = [0, -4] # obj, cls
bias = module_list[-1][0].bias.view(len(mask), -1) # 255 to 3x85 bias = module_list[-1][0].bias.view(len(mask), -1) # 255 to 3x85
bias[:, 4] += b[0] # obj bias[:, 4] += b[0] # obj