Parcourir la source

Add of epsilon value to normalization

Jérôme BUISINE il y a 5 ans
Parent
commit
76b254f539

BIN
docs/build/doctrees/environment.pickle


+ 1 - 1
docs/build/html/.buildinfo

@@ -1,4 +1,4 @@
 # Sphinx build info version 1
 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 6e8868967918653db8d0aa1efdf78b9d
+config: 2dae45f30e990aee580f1ce6331fd796
 tags: 645f666f9bcd5a90fca523b33c5a78b7

+ 2 - 2
docs/build/html/_modules/index.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Overview: module code &mdash; IPFML v0.3.6 documentation</title>
+  <title>Overview: module code &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/exceptions.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.exceptions &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.exceptions &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/filters/noise.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.filters.noise &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.filters.noise &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/iqa/fr.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.iqa.fr &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.iqa.fr &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/metrics.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.metrics &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.metrics &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/_modules/ipfml/processing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.processing &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.processing &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

Fichier diff supprimé car celui-ci est trop grand
+ 12 - 4
docs/build/html/_modules/ipfml/utils.html


+ 1 - 1
docs/build/html/_static/documentation_options.js

@@ -1,6 +1,6 @@
 var DOCUMENTATION_OPTIONS = {
     URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
-    VERSION: 'v0.3.6',
+    VERSION: 'v0.3.7',
     LANGUAGE: 'None',
     COLLAPSE_INDEX: false,
     FILE_SUFFIX: '.html',

+ 2 - 2
docs/build/html/contributing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Contributing &mdash; IPFML v0.3.6 documentation</title>
+  <title>Contributing &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/description.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Description &mdash; IPFML v0.3.6 documentation</title>
+  <title>Description &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/examples.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Examples &mdash; IPFML v0.3.6 documentation</title>
+  <title>Examples &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/genindex.html

@@ -9,7 +9,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Index &mdash; IPFML v0.3.6 documentation</title>
+  <title>Index &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/index.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Image Processing For Machine Learning &mdash; IPFML v0.3.6 documentation</title>
+  <title>Image Processing For Machine Learning &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -57,7 +57,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Documentation &mdash; IPFML v0.3.6 documentation</title>
+  <title>Documentation &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.exceptions.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.exceptions &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.exceptions &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.filters.noise.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.filters.noise &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.filters.noise &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.iqa.fr.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.iqa.fr &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.iqa.fr &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.metrics.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.metrics &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.metrics &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.processing.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.processing &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.processing &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/ipfml/ipfml.utils.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>ipfml.utils &mdash; IPFML v0.3.6 documentation</title>
+  <title>ipfml.utils &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -58,7 +58,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

BIN
docs/build/html/objects.inv


+ 2 - 2
docs/build/html/py-modindex.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Python Module Index &mdash; IPFML v0.3.6 documentation</title>
+  <title>Python Module Index &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -59,7 +59,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/build/html/search.html

@@ -8,7 +8,7 @@
   
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   
-  <title>Search &mdash; IPFML v0.3.6 documentation</title>
+  <title>Search &mdash; IPFML v0.3.7 documentation</title>
   
 
   
@@ -56,7 +56,7 @@
             
             
               <div class="version">
-                0.3.6
+                0.3.7
               </div>
             
           

+ 2 - 2
docs/source/conf.py

@@ -24,9 +24,9 @@ copyright = '2019, Jérôme BUISINE'
 author = 'Jérôme BUISINE'
 
 # The short X.Y version
-version = '0.3.6'
+version = '0.3.7'
 # The full version, including alpha/beta/rc tags
-release = 'v0.3.6'
+release = 'v0.3.7'
 
 
 # -- General configuration ---------------------------------------------------

+ 10 - 2
ipfml/utils.py

@@ -4,6 +4,7 @@ Utils functions of ipfml package (array normalization)
 
 import numpy as np
 import math
+import sys
 
 from scipy.integrate import simps
 
@@ -32,7 +33,11 @@ def normalize_arr(arr):
     min_value = min(arr)
 
     for v in arr:
-        output_arr.append((v - min_value) / (max_value - min_value))
+        try:
+            output_arr.append((v - min_value) / (max_value - min_value))
+        except ZeroDivisionError:
+            output_arr.append((v - min_value) /
+                              (max_value - min_value + sys.float_info.epsilon))
 
     return output_arr
 
@@ -59,7 +64,10 @@ def normalize_arr_with_range(arr, min, max):
     output_arr = []
 
     for v in arr:
-        output_arr.append((v - min) / (max - min))
+        try:
+            output_arr.append((v - min) / (max - min))
+        except ZeroDivisionError:
+            output_arr.append((v - min) / (max - min + sys.float_info.epsilon))
 
     return output_arr
 

+ 1 - 1
setup.py

@@ -31,7 +31,7 @@ class BuildTestCommand(setuptools.command.build_py.build_py):
 
 setup(
     name='ipfml',
-    version='0.3.6',
+    version='0.3.7',
     description='Image Processing For Machine Learning',
     long_description=readme(),
     classifiers=[