imatag-vch
commited on
Commit
•
49bb7b0
1
Parent(s):
c78f615
Upload ResNetForZeroBitWatermarkDetection
Browse files- modeling_resnet.py +3 -3
- pytorch_model.bin +1 -1
modeling_resnet.py
CHANGED
@@ -17,7 +17,7 @@ class ResNetForZeroBitWatermarkDetection(ResNetPreTrainedModel):
|
|
17 |
nn.ReLU(),
|
18 |
nn.Dropout(0.2),
|
19 |
nn.Linear(128, 1))
|
20 |
-
self.register_buffer('
|
21 |
|
22 |
# initialize weights and apply final processing
|
23 |
self.post_init()
|
@@ -40,10 +40,10 @@ class ResNetForZeroBitWatermarkDetection(ResNetPreTrainedModel):
|
|
40 |
x = self.classifier(pooled_output)
|
41 |
|
42 |
# generalized-Gaussian recalibration, centering and scaling is already included in last linear layer
|
43 |
-
x = 0.5 + torch.sign(x) * 0.5 * torch.special.gammainc(1 / self.
|
44 |
|
45 |
# Laplacian calibration, centering and scaling is already included in last linear layer
|
46 |
-
# if
|
47 |
#x = 0.5 + torch.sign(x) * 0.5 * (1 - torch.exp(-torch.abs(x))) # laplacian
|
48 |
|
49 |
logits = torch.log(x) - torch.log1p(-x)
|
|
|
17 |
nn.ReLU(),
|
18 |
nn.Dropout(0.2),
|
19 |
nn.Linear(128, 1))
|
20 |
+
self.register_buffer('exp', torch.tensor([1.0]))
|
21 |
|
22 |
# initialize weights and apply final processing
|
23 |
self.post_init()
|
|
|
40 |
x = self.classifier(pooled_output)
|
41 |
|
42 |
# generalized-Gaussian recalibration, centering and scaling is already included in last linear layer
|
43 |
+
x = 0.5 + torch.sign(x) * 0.5 * torch.special.gammainc(1 / self.exp, torch.abs(x)**self.exp)
|
44 |
|
45 |
# Laplacian calibration, centering and scaling is already included in last linear layer
|
46 |
+
# if exp==1
|
47 |
#x = 0.5 + torch.sign(x) * 0.5 * (1 - torch.exp(-torch.abs(x))) # laplacian
|
48 |
|
49 |
logits = torch.log(x) - torch.log1p(-x)
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 45051585
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2c29c45863f6bf8dc4f1db64a082cb7b9ce44ef163eb29a9ee476f8fe77a5b6f
|
3 |
size 45051585
|