def testMaxEntropy(self):

    entropy = maxEntropy(1,1)
    self.assertAlmostEqual(entropy, 0.0, places=4)

    entropy = maxEntropy(1,0)
    self.assertAlmostEqual(entropy, 0.0, places=4)

    entropy = maxEntropy(4,1)
    self.assertAlmostEqual(entropy, 3.245112498, places=4)

    entropy = maxEntropy(4,2)
    self.assertAlmostEqual(entropy, 4.0, places=4)

    entropy = maxEntropy(100,1)
    self.assertAlmostEqual(entropy, 8.07931359, places=4)

    entropy = maxEntropy(100,10)
    self.assertAlmostEqual(entropy, 46.89955936, places=4)

    entropy = maxEntropy(2048, 40)
    self.assertAlmostEqual(entropy, 284.2634199, places=4)
Esempio n. 2
0
    def testMaxEntropy(self):

        entropy = maxEntropy(1, 1)
        self.assertAlmostEqual(entropy, 0.0, places=4)

        entropy = maxEntropy(1, 0)
        self.assertAlmostEqual(entropy, 0.0, places=4)

        entropy = maxEntropy(4, 1)
        self.assertAlmostEqual(entropy, 3.245112498, places=4)

        entropy = maxEntropy(4, 2)
        self.assertAlmostEqual(entropy, 4.0, places=4)

        entropy = maxEntropy(100, 1)
        self.assertAlmostEqual(entropy, 8.07931359, places=4)

        entropy = maxEntropy(100, 10)
        self.assertAlmostEqual(entropy, 46.89955936, places=4)

        entropy = maxEntropy(2048, 40)
        self.assertAlmostEqual(entropy, 284.2634199, places=4)
Esempio n. 3
0
 def maxEntropy(self):
     """
 Returns the maximum total entropy we can expect from this layer
 """
     return maxEntropy(self.n, self.k)
Esempio n. 4
0
 def maxEntropy(self):
   """
   Returns the maximum entropy we can expect from this layer
   """
   return maxEntropy(self.outputLength, self.k)
Esempio n. 5
0
 def maxEntropy(self):
     """
 Returns the maximum entropy we can expect from this layer
 """
     return maxEntropy(self.outputLength, self.k)
Esempio n. 6
0
 def maxEntropy(self):
   """
   Returns the maximum total entropy we can expect from this layer
   """
   return maxEntropy(self.n, self.k)