This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Non-parametric computation of entropy and mutual-information | |
Adapted by G Varoquaux for code created by R Brette, itself | |
from several papers (see in the code). | |
This code is maintained at https://github.com/mutualinfo/mutual_info | |
Please download the latest code there, to have improvements and | |
bug fixes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy.random import choice, normal | |
np.random.seed(8) | |
from tensorflow import set_random_seed | |
set_random_seed(8) | |
from tensorflow.python.keras.layers import Input, BatchNormalization,Conv2D, MaxPooling2D | |
from tensorflow.python.keras.layers import Dropout, Reshape | |
from tensorflow.python.keras.layers import Dense, Flatten | |
from tensorflow.python.keras.models import Model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
@tf.function | |
def get2dHistogram(x, y, | |
value_range, | |
nbins=100, | |
dtype=tf.dtypes.int32): | |
""" | |
Bins x, y coordinates of points onto simple square 2d histogram | |
Given the tensor x and y: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.