-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Scrubbing LogisticRegression learners #2761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm looking on this one, and I think it would be amount of memory be allocated in MB during training.
|
@@ -47,7 +47,7 @@ public abstract class OptionsBase : LearnerInputBaseWithWeight | |||
[Argument(ArgumentType.AtMostOnce, HelpText = "Maximum iterations.", ShortName = "maxiter")] | |||
[TGUI(Label = "Max Number of Iterations")] | |||
[TlcModule.SweepableLongParamAttribute("MaxIterations", 1, int.MaxValue)] | |||
public int MaxIterations = Defaults.MaxIterations; | |||
public int MaximumIterations = Defaults.MaximumIterations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MaximumIterations [](start = 23, length = 17)
let's stick to NumberOfIterations across all our learners. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -71,7 +71,7 @@ public abstract class OptionsBase : LearnerInputBaseWithWeight | |||
[Argument(ArgumentType.LastOccurenceWins, HelpText = "Init weights diameter", ShortName = "initwts", SortOrder = 140)] | |||
[TGUI(Label = "Initial Weights Scale", SuggestedSweeps = "0,0.1,0.5,1")] | |||
[TlcModule.SweepableFloatParamAttribute("InitWtsDiameter", 0.0f, 1.0f, numSteps: 5)] | |||
public float InitWtsDiameter = 0; | |||
public float InitialWeightsDiameter = 0; | |||
|
|||
// Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Deprecated [](start = 12, length = 13)
:)
can you double check it's true? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like its used... one of our tests MulticlassLogisticRegressionOnnxConversionTest
even uses it by setting it to false
i have added a comment
In reply to: 260874466 [](ancestors = 260874466)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My question is it actually used in logisticRegression code?
Across all other learners we just use NumberOfThreads
to pass how many threads we want to use.
I just don't see reason why this one should be remain public.
In reply to: 260904491 [](ancestors = 260904491,260874466)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made internal for now.
I see several usage of this in TestEntryPoint.cs . As you pointed, we should look into whether we can remove this completely and only use NumberOfThreads
even from EntryPoints
In reply to: 260905721 [](ancestors = 260905721,260904491,260874466)
I think we trying to have following pattern for trainer names: Actually created issue regarding that: #2762 stay tuned! #Pending Refers to: src/Microsoft.ML.StandardLearners/StandardLearnersCatalog.cs:427 in 9ea2076. [](commit_id = 9ea2076, deletion_comment = False) |
i will add that as comment .. in some places its also commented as follows without reference to the Hessian: /// The number of previous iterations to store i think its fine to keep the name as MemorySize. what do u think ? In reply to: 467967467 [](ancestors = 467967467) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:45 in 9ea2076. [](commit_id = 9ea2076, deletion_comment = False) |
I would rather change parameter name to reflect what it does than update documentation. In reply to: 467984224 [](ancestors = 467984224,467967467) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:45 in 9ea2076. [](commit_id = 9ea2076, deletion_comment = False) |
@@ -71,7 +71,7 @@ public abstract class OptionsBase : LearnerInputBaseWithWeight | |||
[Argument(ArgumentType.LastOccurenceWins, HelpText = "Init weights diameter", ShortName = "initwts", SortOrder = 140)] | |||
[TGUI(Label = "Initial Weights Scale", SuggestedSweeps = "0,0.1,0.5,1")] | |||
[TlcModule.SweepableFloatParamAttribute("InitWtsDiameter", 0.0f, 1.0f, numSteps: 5)] | |||
public float InitWtsDiameter = 0; | |||
public float InitialWeightsDiameter = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InitialWeightsDiameter [](start = 25, length = 22)
So when you do this, you need to take old name and put it in ShortName in ArgumentAttribute like this ShortName="initwts,initwtsDiameter"
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- does it apply to all the other renamings as well ? .
- why we adding it to ShortName like that ?
In reply to: 260893400 [](ancestors = 260893400)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
marking as pending . maybe outside purview of this PR we should have separate PR for #2762 once names are finalized In reply to: 467981004 [](ancestors = 467981004) Refers to: src/Microsoft.ML.StandardLearners/StandardLearnersCatalog.cs:427 in 9ea2076. [](commit_id = 9ea2076, deletion_comment = False) |
Codecov Report
@@ Coverage Diff @@
## master #2761 +/- ##
==========================================
+ Coverage 71.68% 71.72% +0.03%
==========================================
Files 808 809 +1
Lines 142402 142491 +89
Branches 16113 16116 +3
==========================================
+ Hits 102076 102195 +119
+ Misses 35893 35860 -33
- Partials 4433 4436 +3
|
should be private protected #Closed Refers to: src/Microsoft.ML.StandardLearners/Standard/LinearModelParameters.cs:265 in 04a4f7a. [](commit_id = 04a4f7a, deletion_comment = False) |
Feels a bit too long. In reply to: 467985202 [](ancestors = 467985202,467984224,467967467) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:45 in 9ea2076. [](commit_id = 9ea2076, deletion_comment = False) |
|
||
/// <summary> | ||
/// Run SGD to initialize LR weights, converging to this tolerance. | ||
/// </summary> | ||
[Argument(ArgumentType.AtMostOnce, HelpText = "Run SGD to initialize LR weights, converging to this tolerance", | ||
ShortName = "sgd")] | ||
public float SgdInitializationTolerance = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SgdInitializationTolerance [](start = 25, length = 26)
StochasticGradientDescentInitilaizationTolerance ? #Resolved
MaxIterations = LbfgsTrainerOptions.MaxIterations; | ||
SgdInitializationTolerance = LbfgsTrainerOptions.SgdInitializationTolerance; | ||
Host.CheckUserArg(!LbfgsTrainerOptions.UseThreads || LbfgsTrainerOptions.NumberOfThreads > 0 || LbfgsTrainerOptions.NumberOfThreads == null, | ||
nameof(LbfgsTrainerOptions.NumberOfThreads), "numThreads must be positive (or empty for default)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numThreads [](start = 60, length = 10)
Must be positive, if provided.
/// If set to <value>true</value>training statistics will be generated at the end of training. | ||
/// </summary> | ||
[Argument(ArgumentType.AtMostOnce, HelpText = "Show statistics of training examples.", ShortName = "stat, ShowTrainingStats", SortOrder = 50)] | ||
public bool ShowTrainingStatistics = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ShowTrainingStatistics [](start = 24, length = 22)
Can you double check it's used?
It strange binary LR and MultiLR has different options (binary LR has extra thing ComputeLogisticRegressionStandardDeviation
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do see it being used for both binary LR, and multiclass LR
machinelearning/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs
Lines 461 to 462 in df2f3fb
if (ShowTrainingStats) | |
ProcessPriorDistribution(cursor.Label, cursor.Weight); |
and here
machinelearning/src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs
Lines 567 to 568 in df2f3fb
if (ShowTrainingStats) | |
ComputeTrainingStatistics(ch, cursorFactory, loss, numParams); |
Binary LR has the additional ComputeLogisticRegressionStandardDeviation
as you noted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rname this without acronyms? #Resolved Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
There is a separate issue #2762 from trainer names..maybe we can address changes (if any) as part of #2762 the scrubbing PRs are focussed on the items mentioned in #2613 In reply to: 469360727 [](ancestors = 469360727) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
I see "no short names" in the items mentioned in #2613. I thought it was part of the scrubbing tasks? In reply to: 469362212 [](ancestors = 469362212,469360727) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
[Argument(ArgumentType.AtMostOnce, HelpText = "Show statistics of training examples.", ShortName = "stat", SortOrder = 50)] | ||
public bool ShowTrainingStats = false; | ||
/// <summary> | ||
/// If set to <value>true</value>training statistics will be generated at the end of training. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a space before training?
please note : "no short names" is for Options , not trainer names (at least thats what i am following. keeping trainer names for #2762) In reply to: 469364309 [](ancestors = 469364309,469362212,469360727) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
OK I see! In reply to: 469376815 [](ancestors = 469376815,469364309,469362212,469360727) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
Sorry for this then In reply to: 469377354 [](ancestors = 469377354,469376815,469364309,469362212,469360727) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries at all .. thanks for noticing actually :) In reply to: 469377514 [](ancestors = 469377514,469377354,469376815,469364309,469362212,469360727) Refers to: src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/LbfgsPredictorBase.cs:18 in 7a7ac78. [](commit_id = 7a7ac78, deletion_comment = False) |
Fixes #2615. Related #2613