Skip to content
Snippets Groups Projects

Cross validation

Merged Anjith GEORGE requested to merge cross_validation into master
1 unresolved thread
2 files
+ 8
4
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -43,7 +43,7 @@ class MCCNN(nn.Module):
@@ -43,7 +43,7 @@ class MCCNN(nn.Module):
The path to download the pretrained LightCNN model from.
The path to download the pretrained LightCNN model from.
"""
"""
def __init__(self, block=resblock, layers=[1, 2, 3, 4], num_channels=4, verbosity_level=2):
def __init__(self, block=resblock, layers=[1, 2, 3, 4], num_channels=4, verbosity_level=2, use_sigmoid=True):
""" Init function
""" Init function
Parameters
Parameters
@@ -51,6 +51,9 @@ class MCCNN(nn.Module):
@@ -51,6 +51,9 @@ class MCCNN(nn.Module):
num_channels: int
num_channels: int
The number of channels present in the input
The number of channels present in the input
 
use_sigmoid: bool
 
Whether to use sigmoid in eval phase. If set to `False` do not use
 
sigmoid in eval phase. Training phase is not affected.
verbosity_level: int
verbosity_level: int
Verbosity level.
Verbosity level.
@@ -58,6 +61,7 @@ class MCCNN(nn.Module):
@@ -58,6 +61,7 @@ class MCCNN(nn.Module):
super(MCCNN, self).__init__()
super(MCCNN, self).__init__()
self.num_channels=num_channels
self.num_channels=num_channels
 
self.use_sigmoid=use_sigmoid
self.lcnn_layers=['conv1','block1','group1','block2', 'group2','block3','group3','block4','group4','fc']
self.lcnn_layers=['conv1','block1','group1','block2', 'group2','block3','group3','block4','group4','fc']
@@ -211,9 +215,9 @@ class MCCNN(nn.Module):
@@ -211,9 +215,9 @@ class MCCNN(nn.Module):
output = self.linear2fc(output)
output = self.linear2fc(output)
#if self.training:
if self.training or self.use_sigmoid:
output=nn.Sigmoid()(output)
output=nn.Sigmoid()(output)
return output
return output
Loading