deepluq 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deepluq
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Package to quantify uncertainty in deep learning models
5
5
  Author-email: Chengjie Lu <chengjielu@simula.no>
6
6
  Maintainer-email: Chengjie Lu <chengjielu@simula.no>
@@ -65,7 +65,7 @@ class DLMetrics:
65
65
  self.shannon_entropy = round(
66
66
  -np.sum([p * (np.log(p + eps) / np.log(base)) for p in events]), 5
67
67
  )
68
- return self.shannon_entropy
68
+ return 0 if self.shannon_entropy < 0 else self.shannon_entropy
69
69
 
70
70
  def calcu_mi(self, events, eps=1e-15, base=2):
71
71
  """
@@ -88,7 +88,7 @@ class DLMetrics:
88
88
 
89
89
  avg_probs = np.mean(np.transpose(events), axis=1)
90
90
  self.mutual_information = self.calcu_entropy(avg_probs) + entropy_component(events)
91
- return self.mutual_information
91
+ return 0 if self.mutual_information < 0 else self.mutual_information
92
92
 
93
93
  # -------------------------------
94
94
  # Total variance metrics
@@ -157,7 +157,7 @@ class DLMetrics:
157
157
  )
158
158
 
159
159
  self.mutual_information = mutual_info
160
- return self.mutual_information
160
+ return 0 if self.mutual_information < 0 else self.mutual_information
161
161
 
162
162
  # -------------------------------
163
163
  # Geometric uncertainty metrics
@@ -1,6 +1,6 @@
1
1
  DEEPLUQ_MAJOR_VERSION = 0
2
2
  DEEPLUQ_MINOR_VERSION = 1
3
- DEEPLUQ_PATCH_LEVEL = 2
3
+ DEEPLUQ_PATCH_LEVEL = 3
4
4
 
5
5
  __version_info__ = (str(DEEPLUQ_MAJOR_VERSION), str(DEEPLUQ_MINOR_VERSION), str(DEEPLUQ_PATCH_LEVEL))
6
6
  __version__ = '.'.join(__version_info__)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: deepluq
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Package to quantify uncertainty in deep learning models
5
5
  Author-email: Chengjie Lu <chengjielu@simula.no>
6
6
  Maintainer-email: Chengjie Lu <chengjielu@simula.no>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes