Initial commit.
[pytorch.git] / mi_estimator.py
index 02e9db9..47381ef 100755 (executable)
@@ -1,22 +1,9 @@
 #!/usr/bin/env python
 
-#########################################################################
-# This program is free software: you can redistribute it and/or modify  #
-# it under the terms of the version 3 of the GNU General Public License #
-# as published by the Free Software Foundation.                         #
-#                                                                       #
-# This program is distributed in the hope that it will be useful, but   #
-# WITHOUT ANY WARRANTY; without even the implied warranty of            #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      #
-# General Public License for more details.                              #
-#                                                                       #
-# You should have received a copy of the GNU General Public License     #
-# along with this program. If not, see <http://www.gnu.org/licenses/>.  #
-#                                                                       #
-# Written by Francois Fleuret, (C) Idiap Research Institute             #
-#                                                                       #
-# Contact <francois.fleuret@idiap.ch> for comments & bug reports        #
-#########################################################################
+# Any copyright is dedicated to the Public Domain.
+# https://creativecommons.org/publicdomain/zero/1.0/
+
+# Written by Francois Fleuret <francois@fleuret.org>
 
 import argparse, math, sys
 from copy import deepcopy
@@ -239,7 +226,7 @@ def create_sequences_pairs(train = False):
 
 class NetForImagePair(nn.Module):
     def __init__(self):
-        super(NetForImagePair, self).__init__()
+        super().__init__()
         self.features_a = nn.Sequential(
             nn.Conv2d(1, 16, kernel_size = 5),
             nn.MaxPool2d(3), nn.ReLU(),
@@ -270,7 +257,7 @@ class NetForImagePair(nn.Module):
 
 class NetForImageValuesPair(nn.Module):
     def __init__(self):
-        super(NetForImageValuesPair, self).__init__()
+        super().__init__()
         self.features_a = nn.Sequential(
             nn.Conv2d(1, 16, kernel_size = 5),
             nn.MaxPool2d(3), nn.ReLU(),
@@ -319,7 +306,7 @@ class NetForSequencePair(nn.Module):
         )
 
     def __init__(self):
-        super(NetForSequencePair, self).__init__()
+        super().__init__()
 
         self.nc = 32
         self.nh = 256