From 32cfd49cbc6139c29eaf4755ec307e0af2fe0fb8 Mon Sep 17 00:00:00 2001 From: LittleLittleCloud Date: Tue, 7 Jan 2020 14:36:55 -0800 Subject: [PATCH 1/2] remove culture info --- src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs b/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs index ae7945d21e..a1026c43f3 100644 --- a/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs +++ b/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs @@ -145,7 +145,7 @@ public SweepableFloatParam(float min, float max, float stepSize = -1, int numSte public override void SetUsingValueText(string valueText) { - RawValue = float.Parse(valueText, CultureInfo.InvariantCulture); + RawValue = float.Parse(valueText); } public override SweepableParam Clone() => From 43af6e7a271331270ac610a3ad1ed96102292dc0 Mon Sep 17 00:00:00 2001 From: LittleLittleCloud Date: Thu, 9 Jan 2020 10:28:55 -0800 Subject: [PATCH 2/2] add invariantculture to both side --- src/Microsoft.ML.AutoML/Sweepers/Parameters.cs | 3 ++- src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.ML.AutoML/Sweepers/Parameters.cs b/src/Microsoft.ML.AutoML/Sweepers/Parameters.cs index 77916f3926..45fe286af8 100644 --- a/src/Microsoft.ML.AutoML/Sweepers/Parameters.cs +++ b/src/Microsoft.ML.AutoML/Sweepers/Parameters.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Globalization; using Microsoft.ML.Internal.Utilities; namespace Microsoft.ML.AutoML @@ -128,7 +129,7 @@ public FloatParameterValue(string name, float value) Runtime.Contracts.Assert(!float.IsNaN(value)); _name = name; _value = value; - _valueText = _value.ToString("R"); + _valueText = _value.ToString("R", CultureInfo.InvariantCulture); } public bool Equals(IParameterValue other) diff --git a/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs b/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs index a1026c43f3..ae7945d21e 100644 --- a/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs +++ b/src/Microsoft.ML.AutoML/Utils/SweepableParamAttributes.cs @@ -145,7 +145,7 @@ public SweepableFloatParam(float min, float max, float stepSize = -1, int numSte public override void SetUsingValueText(string valueText) { - RawValue = float.Parse(valueText); + RawValue = float.Parse(valueText, CultureInfo.InvariantCulture); } public override SweepableParam Clone() =>