Skip to content

Commit f169932

Browse files
author
Ivan Matantsev
committed
Merge branch 'master' into ivanidze/wordembedding
2 parents c7087c7 + a862ccc commit f169932

File tree

17 files changed

+1578
-765
lines changed

17 files changed

+1578
-765
lines changed

.vsts-dotnet-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resources:
2+
containers:
3+
- container: centos7
4+
image: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
5+
6+
phases:
7+
- template: /build/ci/phase-template.yml
8+
parameters:
9+
name: Linux
10+
buildScript: ./build.sh
11+
queue:
12+
container: centos7
13+
14+
- template: /build/ci/phase-template.yml
15+
parameters:
16+
name: Windows_NT
17+
buildScript: build.cmd
18+
queue:
19+
name: Hosted VS2017
20+
demands:
21+
- agent.os -equals Windows_NT

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ To build ML.NET from source please visit our [developers guide](docs/project-doc
4444

4545
| | x64 Debug | x64 Release |
4646
|:---|----------------:|------------------:|
47-
|**Linux**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/linux_release/lastCompletedBuild)|
47+
|**Linux**|[![x64-debug](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|
4848
|**macOS**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/osx10.13_release/lastCompletedBuild)|
49-
|**Windows**|[![x64-debug](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_debug/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_debug/lastCompletedBuild)|[![x64-release](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_release/badge/icon)](https://ci2.dot.net/job/dotnet_machinelearning/job/master/job/windows_nt_release/lastCompletedBuild)|
49+
|**Windows**|[![x64-debug](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|[![x64-release](https://dotnet.visualstudio.com/public/_apis/build/status/104?branch=master)](https://dotnet.visualstudio.com/DotNet-Public/_build/latest?definitionId=104&branch=master)|
5050

5151
## Contributing
5252

build/ci/phase-template.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
parameters:
2+
name: ''
3+
buildScript: ''
4+
queue: {}
5+
6+
phases:
7+
- phase: ${{ parameters.name }}
8+
variables:
9+
_buildScript: ${{ parameters.buildScript }}
10+
_phaseName: ${{ parameters.name }}
11+
queue:
12+
parallel: 2
13+
matrix:
14+
Build_Debug:
15+
_configuration: Debug
16+
Build_Release:
17+
_configuration: Release
18+
${{ insert }}: ${{ parameters.queue }}
19+
steps:
20+
- script: $(_buildScript) -$(_configuration) -runtests
21+
displayName: Build and Test
22+
- task: PublishTestResults@2
23+
displayName: Publish Test Results
24+
condition: succeededOrFailed()
25+
inputs:
26+
testRunner: 'vSTest'
27+
searchFolder: '$(System.DefaultWorkingDirectory)/bin'
28+
testResultsFiles: '**/*.trx'
29+
testRunTitle: Machinelearning_Tests_$(_phaseName)_$(_configuration)_$(Build.BuildNumber)
30+
configuration: $(_configuration)
31+
mergeTestResults: true
32+
- script: $(_buildScript) -buildPackages
33+
displayName: Build Packages

netci.groovy

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,22 @@ import jobs.generation.Utilities;
66
def project = GithubProject
77
def branch = GithubBranchName
88

9-
['Windows_NT', 'Linux', 'OSX10.13'].each { os ->
9+
['OSX10.13'].each { os ->
1010
['Debug', 'Release'].each { config ->
1111
[true, false].each { isPR ->
1212
// Calculate job name
1313
def jobName = os.toLowerCase() + '_' + config.toLowerCase()
14-
def buildFile = '';
1514

1615
def machineAffinity = 'latest-or-auto'
1716

18-
// Calculate the build command
19-
if (os == 'Windows_NT') {
20-
buildFile = ".\\build.cmd"
21-
} else {
22-
buildFile = "./build.sh"
23-
}
24-
25-
def buildCommand = buildFile + " -$config -runtests"
26-
def packCommand = buildFile + " -buildPackages"
27-
2817
def newJob = job(Utilities.getFullJobName(project, jobName, isPR)) {
2918
steps {
30-
if (os == 'Windows_NT') {
31-
batchFile(buildCommand)
32-
batchFile(packCommand)
33-
}
34-
else {
35-
// Shell
36-
shell(buildCommand)
37-
shell(packCommand)
38-
}
19+
shell("./build.sh -$config -runtests")
20+
shell("./build.sh -buildPackages")
3921
}
4022
}
4123

42-
def osImageName = os
43-
if (os == 'Linux') {
44-
// Trigger a portable Linux build that runs on RHEL7.2
45-
osImageName = "RHEL7.2"
46-
}
47-
48-
Utilities.setMachineAffinity(newJob, osImageName, machineAffinity)
24+
Utilities.setMachineAffinity(newJob, os, machineAffinity)
4925
Utilities.standardJobSetup(newJob, project, isPR, "*/${branch}")
5026

5127
if (isPR) {

src/Microsoft.ML.Data/Prediction/Calibrator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,13 +1437,13 @@ public bool SaveAsOnnx(OnnxContext ctx, string[] scoreProbablityColumnNames, str
14371437
string opType = "Affine";
14381438
string linearOutput = ctx.AddIntermediateVariable(null, "linearOutput", true);
14391439
var node = ctx.CreateNode(opType, new[] { scoreProbablityColumnNames[0] },
1440-
new[] { linearOutput }, ctx.GetNodeName(opType), "ai.onnx");
1440+
new[] { linearOutput }, ctx.GetNodeName(opType), "");
14411441
node.AddAttribute("alpha", ParamA * -1);
14421442
node.AddAttribute("beta", -0.0000001);
14431443

14441444
opType = "Sigmoid";
14451445
node = ctx.CreateNode(opType, new[] { linearOutput },
1446-
new[] { scoreProbablityColumnNames[1] }, ctx.GetNodeName(opType), "ai.onnx");
1446+
new[] { scoreProbablityColumnNames[1] }, ctx.GetNodeName(opType), "");
14471447

14481448
return true;
14491449
}

src/Microsoft.ML.Data/Transforms/ConcatTransform.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,6 @@ public void SaveAsOnnx(OnnxContext ctx)
723723
var node = ctx.CreateNode(opType, inputList.Select(t => t.Key),
724724
new[] { ctx.AddIntermediateVariable(outColType, outName) }, ctx.GetNodeName(opType));
725725

726-
node.AddAttribute("inputList", inputList.Select(x => x.Key));
727726
node.AddAttribute("inputdimensions", inputList.Select(x => x.Value));
728727
}
729728
}

src/Microsoft.ML.Data/Transforms/TermTransform.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,10 @@ protected override bool SaveAsOnnxCore(OnnxContext ctx, int iinfo, ColInfo info,
719719
var node = ctx.CreateNode(opType, srcVariableName, dstVariableName, ctx.GetNodeName(opType));
720720
node.AddAttribute("classes_strings", terms.DenseValues());
721721
node.AddAttribute("default_int64", -1);
722-
node.AddAttribute("default_string", DvText.Empty);
722+
//default_string needs to be an empty string but there is a BUG in Lotus that
723+
//throws a validation error when default_string is empty. As a work around, set
724+
//default_string to a space.
725+
node.AddAttribute("default_string", " ");
723726
return true;
724727
}
725728

src/Microsoft.ML.Onnx/OnnxUtils.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,10 @@ public static ModelProto MakeModel(List<NodeProto> nodes, string producerName, s
252252
model.Domain = domain;
253253
model.ProducerName = producerName;
254254
model.ProducerVersion = producerVersion;
255-
model.IrVersion = (long)UniversalModelFormat.Onnx.Version.IrVersion;
255+
model.IrVersion = (long)Version.IrVersion;
256256
model.ModelVersion = modelVersion;
257257
model.OpsetImport.Add(new OperatorSetIdProto() { Domain = "ai.onnx.ml", Version = 1 });
258-
model.OpsetImport.Add(new OperatorSetIdProto() { Domain = "ai.onnx", Version = 6 });
258+
model.OpsetImport.Add(new OperatorSetIdProto() { Domain = "", Version = 7 });
259259
model.Graph = new GraphProto();
260260
var graph = model.Graph;
261261
graph.Node.Add(nodes);

src/Microsoft.ML.StandardLearners/Standard/LinearPredictor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,10 @@ public bool SaveAsOnnx(OnnxContext ctx, string[] outputs, string featureColumn)
238238
string opType = "LinearRegressor";
239239
var node = ctx.CreateNode(opType, new[] { featureColumn }, outputs, ctx.GetNodeName(opType));
240240
// Selection of logit or probit output transform. enum {'NONE', 'LOGIT', 'PROBIT}
241-
node.AddAttribute("post_transform", 0);
241+
node.AddAttribute("post_transform", "NONE");
242242
node.AddAttribute("targets", 1);
243243
node.AddAttribute("coefficients", Weight.DenseValues());
244-
node.AddAttribute("intercepts", Bias);
244+
node.AddAttribute("intercepts", new float[] { Bias });
245245
return true;
246246
}
247247

src/Microsoft.ML.StandardLearners/Standard/LogisticRegression/MulticlassLogisticRegression.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,12 +845,12 @@ public bool SaveAsOnnx(OnnxContext ctx, string[] outputs, string featureColumn)
845845

846846
string opType = "LinearClassifier";
847847
var node = ctx.CreateNode(opType, new[] { featureColumn }, outputs, ctx.GetNodeName(opType));
848-
// Selection of logit or probit output transform. enum {'NONE', 'LOGIT', 'PROBIT}
849-
node.AddAttribute("post_transform", 0);
848+
// Selection of logit or probit output transform. enum {'NONE', 'SOFTMAX', 'LOGISTIC', 'SOFTMAX_ZERO', 'PROBIT}
849+
node.AddAttribute("post_transform", "NONE");
850850
node.AddAttribute("multi_class", true);
851851
node.AddAttribute("coefficients", _weights.SelectMany(w => w.DenseValues()));
852852
node.AddAttribute("intercepts", _biases);
853-
node.AddAttribute("classlabels_strings", _labelNames);
853+
node.AddAttribute("classlabels_ints", Enumerable.Range(0, _numClasses).Select(x => (long)x));
854854
return true;
855855
}
856856

src/Microsoft.ML.Transforms/NAReplaceTransform.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,13 @@ protected override bool SaveAsOnnxCore(OnnxContext ctx, int iinfo, ColInfo info,
632632
node.AddAttribute("replaced_value_float", Single.NaN);
633633

634634
if (!Infos[iinfo].TypeSrc.IsVector)
635-
node.AddAttribute("imputed_value_float", Enumerable.Repeat((float)_repValues[iinfo], 1));
635+
node.AddAttribute("imputed_value_floats", Enumerable.Repeat((float)_repValues[iinfo], 1));
636636
else
637637
{
638638
if (_repIsDefault[iinfo] != null)
639639
node.AddAttribute("imputed_value_floats", (float[])_repValues[iinfo]);
640640
else
641-
node.AddAttribute("imputed_value_float", Enumerable.Repeat((float)_repValues[iinfo], 1));
641+
node.AddAttribute("imputed_value_floats", Enumerable.Repeat((float)_repValues[iinfo], 1));
642642
}
643643

644644
return true;

0 commit comments

Comments
 (0)