Skip to content

Commit 6524fd3

Browse files
committed
merged from master
2 parents 8e91165 + ef169b2 commit 6524fd3

File tree

60 files changed

+697
-19742
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+697
-19742
lines changed

Microsoft.ML.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Tests", "test\
3636
EndProject
3737
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.TestFramework", "test\Microsoft.ML.TestFramework\Microsoft.ML.TestFramework.csproj", "{B5989C06-4FFA-46C1-9D85-9366B34AB0A2}"
3838
EndProject
39-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.InternalStreams", "src\Microsoft.ML.InternalStreams\Microsoft.ML.InternalStreams.csproj", "{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9}"
40-
EndProject
4139
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.Predictor.Tests", "test\Microsoft.ML.Predictor.Tests\Microsoft.ML.Predictor.Tests.csproj", "{6B047E09-39C9-4583-96F3-685D84CA4117}"
4240
EndProject
4341
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.ResultProcessor", "src\Microsoft.ML.ResultProcessor\Microsoft.ML.ResultProcessor.csproj", "{3769FCC3-9AFF-4C37-97E9-6854324681DF}"
@@ -150,10 +148,6 @@ Global
150148
{B5989C06-4FFA-46C1-9D85-9366B34AB0A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
151149
{B5989C06-4FFA-46C1-9D85-9366B34AB0A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
152150
{B5989C06-4FFA-46C1-9D85-9366B34AB0A2}.Release|Any CPU.Build.0 = Release|Any CPU
153-
{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
154-
{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
155-
{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
156-
{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9}.Release|Any CPU.Build.0 = Release|Any CPU
157151
{6B047E09-39C9-4583-96F3-685D84CA4117}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
158152
{6B047E09-39C9-4583-96F3-685D84CA4117}.Debug|Any CPU.Build.0 = Debug|Any CPU
159153
{6B047E09-39C9-4583-96F3-685D84CA4117}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -218,7 +212,6 @@ Global
218212
{2F636A2C-062C-49F4-85F3-60DCADAB6A43} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
219213
{64BC22D3-1E76-41EF-94D8-C79E471FF2DD} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
220214
{B5989C06-4FFA-46C1-9D85-9366B34AB0A2} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
221-
{C4F7938F-7109-43C8-92A5-9BE47C7FF7D9} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
222215
{6B047E09-39C9-4583-96F3-685D84CA4117} = {AED9C836-31E3-4F3F-8ABC-929555D3F3C4}
223216
{3769FCC3-9AFF-4C37-97E9-6854324681DF} = {09EADF06-BE25-4228-AB53-95AE3E15B530}
224217
{B7B593C5-FB8C-4ADA-A638-5B53B47D087E} = {09EADF06-BE25-4228-AB53-95AE3E15B530}

src/Microsoft.ML.Console/Microsoft.ML.Console.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<ProjectReference Include="..\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
1616
<ProjectReference Include="..\Microsoft.ML.Ensemble\Microsoft.ML.Ensemble.csproj" />
1717
<ProjectReference Include="..\Microsoft.ML.FastTree\Microsoft.ML.FastTree.csproj" />
18-
<ProjectReference Include="..\Microsoft.ML.InternalStreams\Microsoft.ML.InternalStreams.csproj" />
1918
<ProjectReference Include="..\Microsoft.ML.KMeansClustering\Microsoft.ML.KMeansClustering.csproj" />
2019
<ProjectReference Include="..\Microsoft.ML.LightGBM\Microsoft.ML.LightGBM.csproj" />
2120
<ProjectReference Include="..\Microsoft.ML.Maml\Microsoft.ML.Maml.csproj" />

src/Microsoft.ML.Core/Environment/HostEnvironmentBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public interface IMessageSource
8787

8888
/// <summary>
8989
/// A <see cref="IHostEnvironment"/> that is also a channel listener can attach
90-
/// listeners for messages, as sent through <see cref="IChannelProvider.StartPipe"/>.
90+
/// listeners for messages, as sent through <see cref="IChannelProvider.StartPipe{TMessage}"/>.
9191
/// </summary>
9292
public interface IMessageDispatcher : IHostEnvironment
9393
{

src/Microsoft.ML.Core/Utilities/DoubleParser.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,6 @@ public static bool TryParse(out Double value, string s, int ichMin, int ichLim,
433433
if (FloatUtils.GetBits(x) != 0 || FloatUtils.GetBits(value) != TopBit || !neg)
434434
{
435435
System.Diagnostics.Debug.WriteLine("*** FloatParser disagrees with Double.TryParse on: {0} ({1} vs {2})", str, FloatUtils.GetBits(x), FloatUtils.GetBits(value));
436-
//if (!_failed)
437-
//{
438-
// // REVIEW: Double.Parse gets several things wrong, like mapping 148e-325 to 0x2 instead of 0x3.
439-
// _failed = true;
440-
// Contracts.Assert(false, string.Format("FloatParser disagrees with Double.TryParse on: {0} ({1} vs {2})", str, FloatUtils.GetBits(x), FloatUtils.GetBits(value)));
441-
//}
442436
}
443437
}
444438
#endif

src/Microsoft.ML.Core/Utilities/MathUtils.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,6 @@ public static Float SoftMax(Float[] inputs, int count)
258258
if (count == 1)
259259
return max;
260260

261-
//else if (leng == 2) {
262-
// return SoftMax(inputs[0], inputs[1]);
263-
//}
264-
265261
double intermediate = 0.0;
266262
Float cutoff = max - LogTolerance;
267263

src/Microsoft.ML.Core/Utilities/VBufferUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,11 +1147,11 @@ private static void ApplyWithCoreCopy<TSrc, TDst>(ref VBuffer<TSrc> src, ref VBu
11471147
/// storing the result in <paramref name="dst"/>, overwriting any of its existing contents.
11481148
/// The contents of <paramref name="dst"/> do not affect calculation. If you instead wish
11491149
/// to calculate a function that reads and writes <paramref name="dst"/>, see
1150-
/// <see cref="ApplyWith"/> and <see cref="ApplyWithEitherDefined"/>. Post-operation,
1150+
/// <see cref="ApplyWith{TSrc,TDst}"/> and <see cref="ApplyWithEitherDefined{TSrc,TDst}"/>. Post-operation,
11511151
/// <paramref name="dst"/> will be dense iff <paramref name="src"/> is dense.
11521152
/// </summary>
1153-
/// <seealso cref="ApplyWith"/>
1154-
/// <seealso cref="ApplyWithEitherDefined"/>
1153+
/// <seealso cref="ApplyWith{TSrc,TDst}"/>
1154+
/// <seealso cref="ApplyWithEitherDefined{TSrc,TDst}"/>
11551155
public static void ApplyIntoEitherDefined<TSrc, TDst>(ref VBuffer<TSrc> src, ref VBuffer<TDst> dst, Func<int, TSrc, TDst> func)
11561156
{
11571157
Contracts.CheckValue(func, nameof(func));

src/Microsoft.ML.Data/DataLoadSave/Text/TextLoaderParser.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ private sealed class ParseStats
137137
private volatile int _cref;
138138

139139
// Total number of rows, number of unparsable values, number of format errors.
140-
private /*volatile*/ long _rowCount;
141-
private /*volatile*/ long _badCount;
142-
private /*volatile*/ long _fmtCount;
140+
private long _rowCount;
141+
private long _badCount;
142+
private long _fmtCount;
143143

144144
public ParseStats(IChannelProvider provider, int cref, long maxShow = MaxShow)
145145
{

src/Microsoft.ML.Data/DataView/Transposer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,7 @@ public static void GetSingleSlotValue<T>(this ITransposeDataView view, int col,
14051405
}
14061406

14071407
/// <summary>
1408-
/// The <see cref="ISlotCursor.GetGetter"/> is parameterized by a type that becomes the
1408+
/// The <see cref="ISlotCursor.GetGetter{TValue}"/> is parameterized by a type that becomes the
14091409
/// type parameter for a <see cref="VBuffer{T}"/>, and this is generally preferable and more
14101410
/// sensible but for various reasons it's often a lot simpler to have a get-getter be over
14111411
/// the actual type returned by the getter, that is, parameterize this by the actual

src/Microsoft.ML.Data/Depricated/Vector/VBufferMathUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public static void AddMultWithOffset(ref VBuffer<Float> src, Float c, ref VBuffe
350350
/// Perform in-place scaling of a vector into another vector as
351351
/// <c><paramref name="dst"/> = <paramref name="src"/> * <paramref name="c"/></c>.
352352
/// This is more or less equivalent to performing the same operation with
353-
/// <see cref="VBufferUtils.ApplyInto"/> except perhaps more efficiently,
353+
/// <see cref="VBufferUtils.ApplyInto{TSrc1,TSrc2,TDst}"/> except perhaps more efficiently,
354354
/// with one exception: if <paramref name="c"/> is 0 and <paramref name="src"/>
355355
/// is sparse, <paramref name="dst"/> will have a count of zero, instead of the
356356
/// same count as <paramref name="src"/>.

src/Microsoft.ML.Data/Scorers/BinaryClassifierScorer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private static ISchemaBoundMapper WrapIfNeeded(IHostEnvironment env, ISchemaBoun
8282
/// <param name="labelNameType">The type of the label names from the metadata (either
8383
/// originating from the key value metadata of the training label column, or deserialized
8484
/// from the model of a bindable mapper)</param>
85-
/// <returns>Whether we can call <see cref="MultiClassClassifierScorer.LabelNameBindableMapper.CreateBound"/> with
85+
/// <returns>Whether we can call <see cref="MultiClassClassifierScorer.LabelNameBindableMapper.CreateBound{T}"/> with
8686
/// this mapper and expect it to succeed</returns>
8787
private static bool CanWrap(ISchemaBoundMapper mapper, ColumnType labelNameType)
8888
{

src/Microsoft.ML.Data/Scorers/MultiClassClassifierScorer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ private static ISchemaBoundMapper WrapIfNeeded(IHostEnvironment env, ISchemaBoun
452452
/// <param name="labelNameType">The type of the label names from the metadata (either
453453
/// originating from the key value metadata of the training label column, or deserialized
454454
/// from the model of a bindable mapper)</param>
455-
/// <returns>Whether we can call <see cref="LabelNameBindableMapper.CreateBound"/> with
455+
/// <returns>Whether we can call <see cref="LabelNameBindableMapper.CreateBound{T}"/> with
456456
/// this mapper and expect it to succeed</returns>
457457
public static bool CanWrap(ISchemaBoundMapper mapper, ColumnType labelNameType)
458458
{

src/Microsoft.ML.FastTree/Application/LogLossApplication.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,6 @@ protected override void GetGradientInOneQuery(int query, int threadIndex)
107107

108108
_gradient[d1] += delta;
109109
_gradient[d2] -= delta;
110-
/*
111-
double labelDiff = (labels[d1] - labels[d2]);
112-
double margin = labelDiff * (_scores[d1] - _scores[d2]);
113-
if (_coef - margin > 0)
114-
{
115-
_gradient[d1] += 0.01 * labelDiff;
116-
_gradient[d2] -= 0.01 * labelDiff;
117-
}
118-
*/
119110
}
120111
}
121112
}

src/Microsoft.ML.FastTree/Application/WinLossSurplusApplication.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ protected override void GetGradientInOneQuery(int query, int threadIndex)
120120

121121
double inverseMaxDCG = _inverseMaxDCGT[query];
122122

123-
//int[] permutation = (threadIndex < 0 ? new int[numDocuments] : _permutationBuffers[threadIndex]);
124123
int[] permutation = _permutationBuffers[threadIndex];
125124

126125
short[] labels = Labels;

src/Microsoft.ML.FastTree/Dataset/FeatureFlock.cs

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -698,20 +698,6 @@ public void FillSplitCandidatesCategoricalLowPopulation(LeastSquaresRegressionTr
698698
var binStats = virtualBins[i];
699699
catFeatureCount += 1 + binStats.SubFeatures.Length;
700700

701-
/*int feature = features[i];
702-
int subfeature = feature - featureMin;
703-
Contracts.Assert(0 <= subfeature && subfeature < Flock.Count);
704-
Contracts.Assert(subfeature <= feature);
705-
Contracts.Assert(learner.TrainData.FlockToFirstFeature(flock) == feature - subfeature);
706-
Contracts.Assert(featureUseCount[feature] >= 0);
707-
Contracts.Assert(Flock.BinCount(subfeature) == 2);
708-
Contracts.Assert(GetMaxBorder(subfeature) == GetMinBorder(subfeature));
709-
710-
var binStats = GetBinStats(GetMinBorder(subfeature));
711-
sumGTTargets += binStats.SumTargets;
712-
if (hasWeights)
713-
sumGTWeights += binStats.SumWeights;*/
714-
715701
sumGTTargets += binStats.SumTargets;
716702
gtCount += binStats.Count;
717703
docsInCurrentGroup += binStats.Count;
@@ -933,21 +919,7 @@ public void FillSplitCandidatesCategoricalNeighborBundling(LeastSquaresRegressio
933919
{
934920
var binStats = virtualBins[i];
935921
catFeatureCount += 1 + binStats.SubFeatures.Length;
936-
937-
/*int feature = features[i];
938-
int subfeature = feature - featureMin;
939-
Contracts.Assert(0 <= subfeature && subfeature < Flock.Count);
940-
Contracts.Assert(subfeature <= feature);
941-
Contracts.Assert(learner.TrainData.FlockToFirstFeature(flock) == feature - subfeature);
942-
Contracts.Assert(featureUseCount[feature] >= 0);
943-
Contracts.Assert(Flock.BinCount(subfeature) == 2);
944-
Contracts.Assert(GetMaxBorder(subfeature) == GetMinBorder(subfeature));
945-
946-
var binStats = GetBinStats(GetMinBorder(subfeature));
947-
sumGTTargets += binStats.SumTargets;
948-
if (hasWeights)
949-
sumGTWeights += binStats.SumWeights;*/
950-
922+
951923
sumGTTargets += binStats.SumTargets;
952924
gtCount += binStats.Count;
953925
docsInCurrentGroup += binStats.Count;

src/Microsoft.ML.FastTree/Dataset/SegmentIntArray.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,8 @@ public static void StatsOfBestEncoding(uint[] ivalues, int bitsForMaxItem, bool
168168

169169
max = 0;
170170
bits = TransitionCost;
171-
//IEnumerator<int> ienum = ivalues.GetEnumerator();
172-
//while (ienum.MoveNext())
173171
for (int i = 0; i < ivalues.Length; ++i)
174172
{
175-
//uint val = (uint)ienum.Current;
176173
uint val = (uint)ivalues[i];
177174
if (val > max)
178175
max = val;

src/Microsoft.ML.FastTree/Dataset/SparseIntArray.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,9 @@ public unsafe int this[int virtualIndex]
546546
{
547547
get
548548
{
549-
//if (virtualIndex < _index) throw new Exception("Index must move forward");
550-
551549
if (virtualIndex < _nextIndex)
552550
return 0;
553551

554-
//if (virtualIndex >= _array._length) throw new IndexOutOfRangeException();
555-
556552
if (virtualIndex == _nextIndex)
557553
return _array._values[_pos];
558554

@@ -561,7 +557,6 @@ public unsafe int this[int virtualIndex]
561557
{
562558
while (_pos < _array._values.Length)
563559
{
564-
//_index = _nextIndex;
565560
_nextIndex += pDeltas[_pos];
566561
if (virtualIndex < _nextIndex)
567562
return 0;

src/Microsoft.ML.FastTree/FastTreeRanking.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,6 @@ private void SetupSecondaryGains(Arguments args)
580580
_secondaryMetricShare = 0.0;
581581
return;
582582
}
583-
//for (int i = 0; i < _secondaryGains.Length; ++i) _secondaryGains[i] *= cmd.secondaryMetricShare;
584583
_secondaryInverseMaxDCGT = DCGCalculator.MaxDCG(_secondaryGains, Dataset.Boundaries,
585584
new int[] { args.lambdaMartMaxTruncation })[0].Select(d => 1.0 / d).ToArray();
586585
}
@@ -727,7 +726,6 @@ protected override void GetGradientInOneQuery(int query, int threadIndex)
727726
double inverseMaxDcg = _inverseMaxDcgt[query];
728727
double secondaryInverseMaxDcg = _secondaryMetricShare == 0 ? 0.0 : _secondaryInverseMaxDcgt[query];
729728

730-
//int[] permutation = (threadIndex < 0 ? new int[numDocuments] : _permutationBuffers[threadIndex]);
731729
int[] permutation = _permutationBuffers[threadIndex];
732730

733731
short[] labels = _labels;

src/Microsoft.ML.FastTree/Microsoft.ML.FastTree.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<ProjectReference Include="..\Microsoft.ML.Core\Microsoft.ML.Core.csproj" />
1313
<ProjectReference Include="..\Microsoft.ML.CpuMath\Microsoft.ML.CpuMath.csproj" />
1414
<ProjectReference Include="..\Microsoft.ML.Data\Microsoft.ML.Data.csproj" />
15-
<ProjectReference Include="..\Microsoft.ML.InternalStreams\Microsoft.ML.InternalStreams.csproj" />
1615
</ItemGroup>
1716

1817
<ItemGroup>

src/Microsoft.ML.FastTree/Training/ScoreTracker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void Initialize(ScoreTracker scores1, RegressionTree tree, DocumentPartit
5353
}
5454

5555
//InitScores -initScores can be null in such case the scores are reinitialized to Zero
56-
private void InitializeScores(double[] initScores /* = null */)
56+
private void InitializeScores(double[] initScores)
5757
{
5858
if (initScores == null)
5959
{

0 commit comments

Comments
 (0)