From 2304f74586be34efb9979dbbeb9d4b2dffc7d70f Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Tue, 28 May 2019 15:18:41 +0200
Subject: [PATCH] Revert "[parameters] Fix numerical parameter type" and
 "[advanced][algorithms][pca] Fixed v1 declaration"

This reverts commit c4bd73ddc3ea109d6e03d94b2deb9f031dba4e55.
and commit ffbd06c16e6ec3453cbff3d7969e7e3da0a62eee.

While the default value can be strings rather than numerical,
they are still handled properly.

However, since the online platform already contains experiments
ran with these "wrong" declaration and to ensure it's coherence,
the examples for API V1 will be kept as is and the schema
validation for v1 will take into account that.

This will allow to keep the current system untouched and ensure
future algorithms to be written correctly.
---
 advanced/algorithms/username/cepstral/1.json     |  4 ++--
 advanced/algorithms/username/cropping_rgb/1.json | 12 ++++++------
 advanced/algorithms/username/dct/1.json          |  6 +++---
 advanced/algorithms/username/energy/1.json       |  4 ++--
 advanced/algorithms/username/gmm/1.json          |  4 ++--
 advanced/algorithms/username/gmm_seed/1.json     |  4 ++--
 advanced/algorithms/username/isv/1.json          |  8 ++++----
 advanced/algorithms/username/isv_enroll/1.json   |  2 +-
 .../algorithms/username/lbphs_features/1.json    | 16 ++++++++--------
 advanced/algorithms/username/mlp_training/1.json |  6 +++---
 advanced/algorithms/username/pca/1.json          |  4 ++--
 advanced/algorithms/username/pca_lda/1.json      |  4 ++--
 advanced/algorithms/username/tantriggs/1.json    | 12 ++++++------
 system/libraries/plot_username/baselib/1.rst     |  4 ++--
 system/plotters/plot_username/isoroc/1.json      | 16 ++++++++--------
 system/plotters/plot_username/isoroc/2.json      | 16 ++++++++--------
 system/plotters/plot_username/scatter/1.json     |  4 ++--
 test/algorithms/username/integers_add/1.json     |  2 +-
 .../username/integers_echo_sleep/1.json          |  2 +-
 19 files changed, 65 insertions(+), 65 deletions(-)

diff --git a/advanced/algorithms/username/cepstral/1.json b/advanced/algorithms/username/cepstral/1.json
index 427372f..149a0ea 100644
--- a/advanced/algorithms/username/cepstral/1.json
+++ b/advanced/algorithms/username/cepstral/1.json
@@ -21,9 +21,9 @@
   ],
   "parameters": {
     "rate": {
-      "default": 16000.0,
+      "default": "16000.0",
       "type": "float64",
-      "description": "sampling rate"
+      "description": "sampling rate" 
     }
   }
 }
diff --git a/advanced/algorithms/username/cropping_rgb/1.json b/advanced/algorithms/username/cropping_rgb/1.json
index c68d007..4f6775e 100644
--- a/advanced/algorithms/username/cropping_rgb/1.json
+++ b/advanced/algorithms/username/cropping_rgb/1.json
@@ -21,32 +21,32 @@
   ],
   "parameters": {
     "crop-height": {
-      "default": 80,
+      "default": "80",
       "type": "uint32",
       "description": "height of the resulting cropped image"
     },
     "crop-width": {
-      "default": 64,
+      "default": "64",
       "type": "uint32",
       "description": "width of the resulting cropped image"
     },
     "right-eye-y": {
-      "default": 16,
+      "default": "16",
       "type": "uint32",
       "description": "y-coordinate of the right eye on the cropped image"
     },
     "right-eye-x": {
-      "default": 15,
+      "default": "15",
       "type": "uint32",
       "description": "x-coordinate of the right eye on the cropped image"
     },
     "left-eye-y": {
-      "default": 16,
+      "default": "16",
       "type": "uint32",
       "description": "y-coordinate of the left eye on the cropped image"
     },
     "left-eye-x": {
-      "default": 48,
+      "default": "48",
       "type": "uint32",
       "description": "x-coordinate of the left eye on the cropped image"
     }
diff --git a/advanced/algorithms/username/dct/1.json b/advanced/algorithms/username/dct/1.json
index 39e75de..264ddd6 100644
--- a/advanced/algorithms/username/dct/1.json
+++ b/advanced/algorithms/username/dct/1.json
@@ -18,17 +18,17 @@
   ],
   "parameters": {
     "block-size": {
-      "default": 12,
+      "default": "12",
       "type": "uint32",
       "description":"Size of the block (in pixels)"
     },
     "block-overlap": {
-      "default": 11,
+      "default": "11",
       "type": "uint32",
       "description":"Size of the block overlap (in pixels)"
     },
     "number-of-components": {
-      "default": 45,
+      "default": "45",
       "type": "uint32",
       "description":"Number of the DCT components kept per block (using the zig-zag ordering)"
     }
diff --git a/advanced/algorithms/username/energy/1.json b/advanced/algorithms/username/energy/1.json
index a6f9934..634f0dc 100644
--- a/advanced/algorithms/username/energy/1.json
+++ b/advanced/algorithms/username/energy/1.json
@@ -18,9 +18,9 @@
   ],
   "parameters": {
     "rate": {
-      "default": 16000.0,
+      "default": "16000.0",
       "type": "float64",
-      "description": "sampling rate"
+      "description": "sampling rate" 
     }
   }
 }
diff --git a/advanced/algorithms/username/gmm/1.json b/advanced/algorithms/username/gmm/1.json
index fea51dc..4402e43 100644
--- a/advanced/algorithms/username/gmm/1.json
+++ b/advanced/algorithms/username/gmm/1.json
@@ -18,12 +18,12 @@
   ],
   "parameters": {
     "number-of-gaussians": {
-      "default": 100,
+      "default": "100",
       "type": "uint32",
       "description":" The number of Gaussian Components"
     },
     "maximum-number-of-iterations": {
-      "default": 10,
+      "default": "10",
       "type": "uint32",
       "description":"The maximum number of iterations for the EM algorithm"
     }
diff --git a/advanced/algorithms/username/gmm_seed/1.json b/advanced/algorithms/username/gmm_seed/1.json
index 66f5a8b..121f51b 100644
--- a/advanced/algorithms/username/gmm_seed/1.json
+++ b/advanced/algorithms/username/gmm_seed/1.json
@@ -18,12 +18,12 @@
   ],
   "parameters": {
     "number-of-gaussians": {
-      "default": 100,
+      "default": "100",
       "type": "uint32",
       "description":"The number of Gaussian Components"
     },
     "maximum-number-of-iterations": {
-      "default": 10,
+      "default": "10",
       "type": "uint32",
       "description":"The maximum number of iterations for the EM algorithm"
     }
diff --git a/advanced/algorithms/username/isv/1.json b/advanced/algorithms/username/isv/1.json
index ef0cb26..18cbe1d 100644
--- a/advanced/algorithms/username/isv/1.json
+++ b/advanced/algorithms/username/isv/1.json
@@ -25,22 +25,22 @@
   ],
   "parameters": {
     "isv-training-iterations": {
-      "default": 10,
+      "default": "10",
       "type": "uint32",
       "description": "The maximum number of iterations for the EM algorithm."
     },
     "relevance-factor": {
-      "default": 4.0,
+      "default": "4.0",
       "type": "float64",
       "description": "The relevance factor used for the client specific shift."
     },
     "subspace-dimension-of-u": {
-      "default": 50,
+      "default": "50",
       "type": "uint32",
       "description":"The dimension of the U subspace. In the end the U subspace has the size (CM,subspace-dimension-of-u), where C is the number of gaussian components and M is the dimensionality of the feature vector."
     },
     "init-seed": {
-      "default": 0,
+      "default": "0",
       "type": "uint32",
       "description":"Seed for the pseudo random number generator"
     }
diff --git a/advanced/algorithms/username/isv_enroll/1.json b/advanced/algorithms/username/isv_enroll/1.json
index 5c6d4aa..3c21bb5 100644
--- a/advanced/algorithms/username/isv_enroll/1.json
+++ b/advanced/algorithms/username/isv_enroll/1.json
@@ -32,7 +32,7 @@
   ],
   "parameters": {
     "isv-enroll-iterations": {
-      "default": 1,
+      "default": "1",
       "type": "uint32",
       "description":"The maximum number of iterations for the EM algorithm."
     }
diff --git a/advanced/algorithms/username/lbphs_features/1.json b/advanced/algorithms/username/lbphs_features/1.json
index 6120100..54e5155 100644
--- a/advanced/algorithms/username/lbphs_features/1.json
+++ b/advanced/algorithms/username/lbphs_features/1.json
@@ -22,42 +22,42 @@
   "parameters": {
     "crop-height": {
       "description": "The height of the cropped image",
-      "default": 80,
+      "default": "80",
       "type": "uint32"
     },
     "crop-width": {
       "description": "The width of the cropped image",
-      "default": 64,
+      "default": "64",
       "type": "uint32"
     },
     "right-eye-y": {
       "description": "The vertical position of the right eye (subject perspective) in the cropped image",
-      "default": 16,
+      "default": "16",
       "type": "uint32"
     },
     "right-eye-x": {
       "description": "The horizontal position of the right eye (subject perspective) in the cropped image",
-      "default": 15,
+      "default": "15",
       "type": "uint32"
     },
     "left-eye-y": {
       "description": "The vertical position of the left eye (subject perspective) in the cropped image",
-      "default": 16,
+      "default": "16",
       "type": "uint32"
     },
     "left-eye-x": {
       "description": "The horizontal position of the left eye (subject perspective) in the cropped image",
-      "default": 48,
+      "default": "48",
       "type": "uint32"
     },
     "block-size": {
       "description": "The size of the image blocks, from which local histograms should be extracted",
-      "default": 12,
+      "default": "12",
       "type": "uint32"
     },
     "block-overlap": {
       "description": "The overlap of those block, must be smaller than the block-size",
-      "default": 11,
+      "default": "11",
       "type": "uint32"
     }
   }
diff --git a/advanced/algorithms/username/mlp_training/1.json b/advanced/algorithms/username/mlp_training/1.json
index 21c9462..d926179 100644
--- a/advanced/algorithms/username/mlp_training/1.json
+++ b/advanced/algorithms/username/mlp_training/1.json
@@ -21,17 +21,17 @@
   ],
   "parameters": {
     "number-of-hidden-units": {
-      "default": 10,
+      "default": "10",
       "type": "uint32",
       "description": "the number of hidden uints in the hidden layer. If set to 0, no hidden layer is employed."
     },
     "number-of-iterations": {
-      "default": 50,
+      "default": "50",
       "type": "uint32",
       "description": "the number of training iteration (R-prop iterations)"
     },
     "seed": {
-      "default": 0,
+      "default": "0",
       "type": "uint32",
       "description": "the seed of the random number generator used to generate batch of samples"
     }
diff --git a/advanced/algorithms/username/pca/1.json b/advanced/algorithms/username/pca/1.json
index 86e6aaf..285f01e 100644
--- a/advanced/algorithms/username/pca/1.json
+++ b/advanced/algorithms/username/pca/1.json
@@ -18,9 +18,9 @@
   ],
   "parameters": {
     "number-of-components": {
-      "default": 5,
+      "default": "5",
       "type": "uint32",
-      "description": "the number of dimensions to retain after applying PCA"
+      "number-of-components": "the number of dimensions to retain after applying PCA"
     }
   }
 }
diff --git a/advanced/algorithms/username/pca_lda/1.json b/advanced/algorithms/username/pca_lda/1.json
index 1026da8..2a87213 100644
--- a/advanced/algorithms/username/pca_lda/1.json
+++ b/advanced/algorithms/username/pca_lda/1.json
@@ -24,12 +24,12 @@
   ],
   "parameters": {
     "number-of-pca-components": {
-      "default": 5,
+      "default": "5",
       "type": "uint32",
       "description": "the number of dimensions to retain after applying PCA"
     },
     "number-of-lda-components": {
-      "default": 2,
+      "default": "2",
       "type": "uint32",
       "description": "the number of dimensions to retain after applying LDA"
     }
diff --git a/advanced/algorithms/username/tantriggs/1.json b/advanced/algorithms/username/tantriggs/1.json
index f274b80..4a79366 100644
--- a/advanced/algorithms/username/tantriggs/1.json
+++ b/advanced/algorithms/username/tantriggs/1.json
@@ -18,32 +18,32 @@
   ],
   "parameters": {
     "sigma0": {
-      "default": 1.0,
+      "default": "1.0",
       "type": "float64",
       "description": "variance of the first Gaussian filter for the Difference of Gaussian"
     },
     "sigma1": {
-      "default": 2.0,
+      "default": "2.0",
       "type": "float64",
       "description": "variance of the second Gaussian filter for the Difference of Gaussian"
     },
     "gamma": {
-      "default": 0.2,
+      "default": "0.2",
       "type": "float64",
       "description": "exponent for the gamma correction"
     },
     "kernel_size": {
-      "default": 5,
+      "default": "5",
       "type": "int64",
       "description": "size of the Gaussian kernels for the Difference of Gaussian"
     },
     "threshold": {
-      "default": 10.0,
+      "default": "10.0",
       "type": "float64",
       "description": "threshold for the contrast equalization"
     },
     "alpha": {
-      "default": 0.1,
+      "default": "0.1",
       "type": "float64",
       "description": "exponent for the contrast equalization"
     }
diff --git a/system/libraries/plot_username/baselib/1.rst b/system/libraries/plot_username/baselib/1.rst
index 5918fb3..7bf0d61 100644
--- a/system/libraries/plot_username/baselib/1.rst
+++ b/system/libraries/plot_username/baselib/1.rst
@@ -81,12 +81,12 @@ into account)::
         "description": "The title for this plot"
       },
       "xaxis_multiplier": {
-        "default": 1.0,
+        "default": "1.0",
         "type": "float64",
         "description": "The multiplication factor for the X-axis (horizontal)"
       },
       "yaxis_multiplier": {
-        "default": 1.0,
+        "default": "1.0",
         "type": "float64",
         "description": "The multiplication factor for the Y-axis (vertical)"
       },
diff --git a/system/plotters/plot_username/isoroc/1.json b/system/plotters/plot_username/isoroc/1.json
index c806c7b..e404a23 100644
--- a/system/plotters/plot_username/isoroc/1.json
+++ b/system/plotters/plot_username/isoroc/1.json
@@ -17,22 +17,22 @@
       "description": "The label of the Y-axis (vertical)"
     },
      "xlim-left":{
-           "default": 0.0,
+           "default": "0.0",
            "type": "float64",
            "description": ""
      },
      "xlim-right":{
-           "default": 100.0,
+           "default": "100.0",
            "type": "float64",
            "description": ""
      },
      "ylim-bottom":{
-           "default": 0.0,
+           "default": "0.0",
            "type": "float64",
            "description": ""
      },
      "ylim-top":{
-           "default": 100.0,
+           "default": "100.0",
            "type": "float64",
            "description": ""
      },
@@ -47,22 +47,22 @@
       "description": "Controls the title font size"
     },
     "xaxis_multiplier": {
-      "default": 100.0,
+      "default": "100.0",
       "type": "float64",
       "description": "The multiplication factor for the X-axis (horizontal)"
     },
     "yaxis_multiplier": {
-      "default": 100.0,
+      "default": "100.0",
       "type": "float64",
       "description": "The multiplication factor for the Y-axis (vertical)"
     },
-
+      
     "axis-fontsize": {
       "default": 10,
       "type": "uint16",
       "description": "Controls the axis font size (labels and values)"
     },
-
+      
     "legend": {
       "default": "",
       "type": "string",
diff --git a/system/plotters/plot_username/isoroc/2.json b/system/plotters/plot_username/isoroc/2.json
index c806c7b..e404a23 100644
--- a/system/plotters/plot_username/isoroc/2.json
+++ b/system/plotters/plot_username/isoroc/2.json
@@ -17,22 +17,22 @@
       "description": "The label of the Y-axis (vertical)"
     },
      "xlim-left":{
-           "default": 0.0,
+           "default": "0.0",
            "type": "float64",
            "description": ""
      },
      "xlim-right":{
-           "default": 100.0,
+           "default": "100.0",
            "type": "float64",
            "description": ""
      },
      "ylim-bottom":{
-           "default": 0.0,
+           "default": "0.0",
            "type": "float64",
            "description": ""
      },
      "ylim-top":{
-           "default": 100.0,
+           "default": "100.0",
            "type": "float64",
            "description": ""
      },
@@ -47,22 +47,22 @@
       "description": "Controls the title font size"
     },
     "xaxis_multiplier": {
-      "default": 100.0,
+      "default": "100.0",
       "type": "float64",
       "description": "The multiplication factor for the X-axis (horizontal)"
     },
     "yaxis_multiplier": {
-      "default": 100.0,
+      "default": "100.0",
       "type": "float64",
       "description": "The multiplication factor for the Y-axis (vertical)"
     },
-
+      
     "axis-fontsize": {
       "default": 10,
       "type": "uint16",
       "description": "Controls the axis font size (labels and values)"
     },
-
+      
     "legend": {
       "default": "",
       "type": "string",
diff --git a/system/plotters/plot_username/scatter/1.json b/system/plotters/plot_username/scatter/1.json
index de01f88..efde418 100644
--- a/system/plotters/plot_username/scatter/1.json
+++ b/system/plotters/plot_username/scatter/1.json
@@ -22,12 +22,12 @@
       "description": "The title for this plot"
     },
     "xaxis_multiplier": {
-      "default": 1.0,
+      "default": "1.0",
       "type": "float64",
       "description": "The multiplication factor for the X-axis (horizontal)"
     },
     "yaxis_multiplier": {
-      "default": 1.0,
+      "default": "1.0",
       "type": "float64",
       "description": "The multiplication factor for the Y-axis (vertical)"
     },
diff --git a/test/algorithms/username/integers_add/1.json b/test/algorithms/username/integers_add/1.json
index 3218781..488db3c 100644
--- a/test/algorithms/username/integers_add/1.json
+++ b/test/algorithms/username/integers_add/1.json
@@ -18,7 +18,7 @@
   ],
   "parameters": {
     "offset": {
-      "default": 1,
+      "default": "1",
       "type": "int32"
     }
   },
diff --git a/test/algorithms/username/integers_echo_sleep/1.json b/test/algorithms/username/integers_echo_sleep/1.json
index 0d55980..ec05a6e7 100644
--- a/test/algorithms/username/integers_echo_sleep/1.json
+++ b/test/algorithms/username/integers_echo_sleep/1.json
@@ -18,7 +18,7 @@
   ],
   "parameters": {
     "delay": {
-      "default": 30,
+      "default": "30",
       "type": "uint32",
       "description": "Time to sleep in seconds"
     }
-- 
GitLab