From a0e3043698cd0fb0d7cffd5f87d0ace2dd3924be Mon Sep 17 00:00:00 2001 From: HantingChen <40243544+HantingChen@users.noreply.github.com> Date: Wed, 7 Jun 2023 18:33:03 +0800 Subject: [PATCH] Update vanillanet.py --- models/vanillanet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/vanillanet.py b/models/vanillanet.py index c6417a3..e04c10f 100644 --- a/models/vanillanet.py +++ b/models/vanillanet.py @@ -10,7 +10,7 @@ from timm.models.layers import weight_init, DropPath from timm.models.registry import register_model - +# Series informed activation function. Implemented by conv. class activation(nn.ReLU): def __init__(self, dim, act_num=3, deploy=False): super(activation, self).__init__() @@ -84,7 +84,10 @@ def forward(self, x): x = self.conv(x) else: x = self.conv1(x) + + # We use leakyrelu to implement the deep training technique. x = torch.nn.functional.leaky_relu(x,self.act_learn) + x = self.conv2(x) x = self.pool(x)