Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Rename Microsoft.ML.StandardLearners - #2792

Merged
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming
Mar 11, 2019
Merged

Rename Microsoft.ML.StandardLearners#2792
codemzs merged 2 commits into
dotnet:masterfrom
Potapy4:renaming

Conversation

@Potapy4

Copy link
Copy Markdown
Contributor

Summary

I renamed StandardLearners to StandardTrainers. If I missed something, please let me know 👌
Fixes#2786


We are excited to review your PR.

So we can do the best job, please check:

  • There's a descriptive title that will make sense to other developers some time from now.
  • There's associated issues. All PR's should have issue(s) associated - unless a trivial self-evident change such as fixing a typo. You can use the format Fixes #nnnn in your description to cause GitHub to automatically close the issue(s) when your PR is merged.
  • Your change description explains what the change does, why you chose your approach, and anything else that reviewers should know.
  • You have included any necessary tests in the same PR.

@codemzs

codemzs commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4 Thank you for your contribution. Our policy for working on a task is to make sure it isn’t assigned to anyone already. In this case it was assigned to me and that means I could already be working on it. Please feel free to assign this task to yourself but moving forward make sure to check no one is already working on a task before assigning it to yourself and only then start the work.

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

Hi @Potapy4 , thank you for working on this. Though, as @codemzs explains, we typically use the "assigned" field on issues to indicate that someone is actually actively working on it, which might lead to duplication of effort if someone else likewise takes on the work. But let's call that past praying for now. 😄

This test failure LoadEntryPointModel is an interesting one.

As we see of point 4 on this PR #970, we wrote the assembly name into the model file, so that we can find the loader signature later. This is on a whole a valuable change, and I think it will serve us well going forward. In this case it presents a difficulty, because in this case we are testing that our model loading is backwards compatible, as we do in several places. However those older models were saved with the old assembly name. It is here:

_ectx.AssertValue(env,"env");
_ectx.Assert(Reader.BaseStream.Position==FpMin+Header.FpModel);
varargs=ConcatArgsRev(extra,this);
EnsureLoaderAssemblyIsRegistered(env.ComponentCatalog);
objecttmp;
stringsig=ModelHeader.GetLoaderSig(refHeader);
if(!string.IsNullOrWhiteSpace(sig)&&
ComponentCatalog.TryCreateInstance<object,TSig>(env,outtmp,sig,"",args))

I see several alternatives, of which I can identify two as possibly best. But between these I am not certain which is best. Note that this same difficulty @Potapy4 has faced here will crop up again when we rename the so-called HalLearner's assembly, as well as fold Microsoft.ML.Transforms into Microsoft.ML.Data.

  1. We take advantage of the fact that we are in preview mode (which is of course why we are undertaking all these breaking changes now, since we cannot do them later!), and say, "backwards compatibility with models built in preview are not a goal," and change the models in the test appropriately.

  2. Internal to our own code, we have code that detects one of the "obsolete" Microsoft.ML.* assemblies of interest (in this case so far there is only one, .StandardLearners) we replace it with the desirable target assembly. Having magic strings in our codebase is a bit undesirable, but might be more desirable than just flat out failing. It would be relatively straightforward to add to the code, and when the time comes and we rename HalLearners in the coming days it may be desirable.

I myself believe 2 is correct, but I am not certain. It would be relatively easy to do I think. The code that fails is here, when we ensure the stored assembly actually has its DI components properly detected and registered.

privatevoidEnsureLoaderAssemblyIsRegistered(ComponentCatalogcatalog)
{
if(!string.IsNullOrEmpty(LoaderAssemblyName))
{
varassembly=Assembly.Load(LoaderAssemblyName);
catalog.RegisterAssembly(assembly);
}
}

We could imagine an auxiliary property ForwardedLoaderAssemblyName of roughly this form (pseudocode, don't take literally)...

privatestringForwardedLoaderAssemblyName{get{switch(LoaderAssemblyName){case"Microsoft.ML.StandardLearners":return"Microsoft.ML.StandardTrainers";default:returnLoaderAssemblyName;}}}

Then we change the ensure loaded to work over this private ForwardedLoaderAssemblyName property, and when the time comes to rename the others, we have a mechanism in place to do so.

@TomFinley

Copy link
Copy Markdown
Contributor

In addition to people already involved on thread I'd welcome the thoughts of @eerhardt. He wrote this assembly storing code and might have anticipated this problem and already have a solution in mind. Of course anyone can participate.

@eerhardt

Copy link
Copy Markdown
Member

My initial reaction is to lean towards solution (1) above - we've been in preview mode for the past year, I don't think we've strictly guaranteed that we aren't going to break things from preview release to preview release. The API for sure has gone through vast breaking changes. Requiring people to re-build their models one more time might not be horrible.

That being said - this is the last time we get to say these things. Once v1.0 is shipped, there is absolutely no questions here - we need to support model compatibility.

However, solution (2) is so simple that it may be worth doing, the cost of adding that code one time, and keeping it forever, is probably way less than the effort it will take to triage bugs and questions about why their old model no longer works. If it was more complex code, I would rethink that position.

So, in the end, it is probably "worth" doing solution (2).

@TomFinley

TomFinley commented Feb 28, 2019

Copy link
Copy Markdown
Contributor

So, in the end, it is probably "worth" doing solution (2).

I think so too. So maybe we say, "OK, let's just have this assembly forwarding." Are you comfortable doing that @Potapy4 ?

A natural followup question (which we do not have to answer now) is what .NET team considers a breaking change in the API, whether if we ship this capability in v1.0 to read pre-release versions, we are under obligation to keep it, provided the version v1.0 remains available for whoever might want to convert models (by simply reading and writing them)? You mentioned "keeping it forever" which suggests you would consider it a breaking change. Yet, sometimes I observe some libraries and tools say, "look, we dropped backward compatibility models for version X in version Z, but version Y reads version X format and writes in a format Z understands." (Where X < Y < Z.) This is quite common, but like many common things may be wrong. (This is surely a sliding scale. By some very strict standards, even a change in ToString overload formatting could be considered a breaking change in an API. 😄 My expectation is that .NET team is very strict, but I wonder how much wiggle room a little library like ours might have.)

But that followup question may not be one we want to answer right now. I would be interested though in your perspective.

@eerhardt

eerhardt commented Feb 28, 2019

Copy link
Copy Markdown
Member

@Potapy4

Copy link
Copy Markdown
ContributorAuthor

Alright, first of all @codemzs I would like to apologize for taking this task from your plate - my bad 😔 next time I check the issues before I start working on them.

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

@TomFinley

Copy link
Copy Markdown
Contributor

@TomFinley thanks for the good and detailed explanation about the tests. ❤️ I think we can use the second approach and make this "hack" right now. I also liked your pseudo-code, but I prefer if instead of switch - and I think that in this case if - this is more than enough. But if we gonna fix it later, do we have to somehow mark this place right now (I mean leave a link to issue or comment with TODO in code)?

Sounds fine thanks @Potapy4 . My reasoning for preferring the switch is I know for a fact that there will be two others in the immediate future that can use the same mechanism, but of course this can be changed at any time. So that sounds fine.

I wouldn't worry too much about a TODO, since I would consider this work to be part of the other assembly renaming work, which I will be reviewing no doubt.

@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

@TomFinley

TomFinley commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

@Potapy4 I'm seeing you still haven't assigned the associated issue to yourself.

I don't think people can assign issues to themselves that do not have write access but I could be wrong. I cannot assign him and I do have write access. @codemzs , can you do it? Because, I cannot, I am not sure he can, so since you seem to think it necessary maybe you can figure out what's up. Thanks!

@eerhardt

Copy link
Copy Markdown
Member

https://help.github.com/en/articles/assigning-issues-and-pull-requests-to-other-github-users

If you have write access to a repository, you can assign issues and pull requests to yourself, collaborators on personal projects, or members of your organization with read permissions on the repository.

members of your organization is the key there. Non-members need to accept an invitation first before they can be assigned issues.

Comment threadsrc/Microsoft.ML.Core/Data/ModelLoadContext.cs Outdated
@codemzs

Copy link
Copy Markdown
Member

@Potapy4 I just forced pushed the changes into your branch so that we can close this PR soon as its been open for a while. @TomFinley Lets review and close this stuff ....

@codemzs
codemzs self-requested a review March 11, 2019 06:53

@codemzscodemzs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @codemzs and @Potapy4 ! LGTM.

@codecov

codecovBot commented Mar 11, 2019

Copy link
Copy Markdown

Codecov Report

Merging #2792 into master will increase coverage by 0.01%.
The diff coverage is 50%.

@@ Coverage Diff @@## master #2792 +/- ##
==========================================
+ Coverage 71.8% 71.82% +0.01% 
==========================================
Files 812 812 Lines 142644 142649 +5 Branches 16090 16090 ==========================================
+ Hits 102432 102460 +28 + Misses 35828 35803 -25 - Partials 4384 4386 +2
FlagCoverage Δ
#Debug71.82% <50%> (+0.01%)⬆️
#production67.97% <50%> (+0.02%)⬆️
#test86.24% <ø> (ø)⬆️
Impacted FilesCoverage Δ
...tionMachine/FieldAwareFactorizationMachineUtils.cs98.03% <ø> (ø)
...oft.ML.StandardTrainers/Standard/SdcaMultiClass.cs92.22% <ø> (ø)
....StandardTrainers/Standard/LinearPredictorUtils.cs26.71% <ø> (ø)
...L.StandardTrainers/Standard/Online/OnlineLinear.cs79.43% <ø> (ø)
...ers/Standard/MultiClass/PairwiseCouplingTrainer.cs88.6% <ø> (ø)
...LogisticRegression/MulticlassLogisticRegression.cs67.46% <ø> (ø)
...rosoft.ML.StandardTrainers/Optimizer/LineSearch.cs0% <ø> (ø)
.../Standard/LogisticRegression/LbfgsPredictorBase.cs71.26% <ø> (ø)
test/Microsoft.ML.FSharp.Tests/SmokeTests.fs96.07% <ø> (ø)⬆️
...crosoft.ML.StandardTrainers/Optimizer/Optimizer.cs73.33% <ø> (ø)
... and 29 more

Comment threaddocs/code/EntryPoints.md Outdated
@codemzscodemzs self-assigned this Mar 11, 2019
@codemzs
codemzs merged commit 005fe05 into dotnet:masterMar 11, 2019
@Potapy4
Potapy4 deleted the renaming branch March 12, 2019 14:42
@ghostghost locked as resolved and limited conversation to collaborators Mar 24, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename Microsoft.ML.StandardLearners to Microsoft.ML.StandardTrainers.

4 participants

@Potapy4@codemzs@TomFinley@eerhardt