delte unused params (#9078)

pull/9097/head
Double_V 2023-02-15 10:37:40 +08:00 committed by GitHub
parent 0850586667
commit a923f35de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 11 deletions

View File

@ -31,7 +31,7 @@ def get_bias_attr(k):
class Head(nn.Layer): class Head(nn.Layer):
def __init__(self, in_channels, name_list, kernel_list=[3, 2, 2], **kwargs): def __init__(self, in_channels, kernel_list=[3, 2, 2], **kwargs):
super(Head, self).__init__() super(Head, self).__init__()
self.conv1 = nn.Conv2D( self.conv1 = nn.Conv2D(
@ -93,16 +93,8 @@ class DBHead(nn.Layer):
def __init__(self, in_channels, k=50, **kwargs): def __init__(self, in_channels, k=50, **kwargs):
super(DBHead, self).__init__() super(DBHead, self).__init__()
self.k = k self.k = k
binarize_name_list = [ self.binarize = Head(in_channels, **kwargs)
'conv2d_56', 'batch_norm_47', 'conv2d_transpose_0', 'batch_norm_48', self.thresh = Head(in_channels, **kwargs)
'conv2d_transpose_1', 'binarize'
]
thresh_name_list = [
'conv2d_57', 'batch_norm_49', 'conv2d_transpose_2', 'batch_norm_50',
'conv2d_transpose_3', 'thresh'
]
self.binarize = Head(in_channels, binarize_name_list, **kwargs)
self.thresh = Head(in_channels, thresh_name_list, **kwargs)
def step_function(self, x, y): def step_function(self, x, y):
return paddle.reciprocal(1 + paddle.exp(-self.k * (x - y))) return paddle.reciprocal(1 + paddle.exp(-self.k * (x - y)))