From b0e213a468726f721990fdbe0837cc6cdce10427 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Wed, 18 Dec 2019 16:51:25 +0100 Subject: [PATCH] Update. --- mi_estimator.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/mi_estimator.py b/mi_estimator.py index f8b859d..02e9db9 100755 --- a/mi_estimator.py +++ b/mi_estimator.py @@ -13,7 +13,8 @@ # You should have received a copy of the GNU General Public License # # along with this program. If not, see . # # # -# Written by and Copyright (C) Francois Fleuret # +# Written by Francois Fleuret, (C) Idiap Research Institute # +# # # Contact for comments & bug reports # ######################################################################### @@ -38,19 +39,20 @@ else: parser = argparse.ArgumentParser( description = '''An implementation of a Mutual Information estimator with a deep model -Three different toy data-sets are implemented: + Three different toy data-sets are implemented, each consists of + pairs of samples, that may be from different spaces: - (1) Two MNIST images of same class. The "true" MI is the log of the - number of used MNIST classes. + (1) Two MNIST images of same class. The "true" MI is the log of the + number of used MNIST classes. - (2) One MNIST image and a pair of real numbers whose difference is - the class of the image. The "true" MI is the log of the number of - used MNIST classes. + (2) One MNIST image and a pair of real numbers whose difference is + the class of the image. The "true" MI is the log of the number of + used MNIST classes. - (3) Two 1d sequences, the first with a single peak, the second with - two peaks, and the height of the peak in the first is the - difference of timing of the peaks in the second. The "true" MI is - the log of the number of possible peak heights.''', + (3) Two 1d sequences, the first with a single peak, the second with + two peaks, and the height of the peak in the first is the + difference of timing of the peaks in the second. The "true" MI is + the log of the number of possible peak heights.''', formatter_class = argparse.ArgumentDefaultsHelpFormatter ) @@ -197,6 +199,8 @@ def create_image_values_pairs(train = False): ###################################################################### +# + def create_sequences_pairs(train = False): nb, length = 10000, 1024 noise_level = 2e-2 @@ -229,9 +233,6 @@ def create_sequences_pairs(train = False): noise = b.new(b.size()).normal_(0, noise_level) b = b + noise - # a = (a - a.mean()) / a.std() - # b = (b - b.mean()) / b.std() - return a, b, ha ###################################################################### -- 2.39.5