189 instantiations of VBuffer
Microsoft.Data.Analysis.Tests (7)
DataFrame.IOTests.cs (3)
950
new
VBuffer
<int> (3, new int[] { 1, 2, 3 }),
951
new
VBuffer
<int> (3, new int[] { 2, 3, 4 }),
952
new
VBuffer
<int> (3, new int[] { 3, 4, 5 }),
DataFrameTests.Utils.cs (1)
79
var buffers = Enumerable.Repeat(new
VBuffer
<int>(5, new[] { 0, 1, 2, 3, 4 }), length).ToArray();
VBufferColumnTests.cs (3)
22
var buffers = Enumerable.Repeat(new
VBuffer
<int>(5, new[] { 0, 1, 2, 3, 4 }), 10).ToArray();
33
var buffer = new
VBuffer
<int>(5, new[] { 4, 3, 2, 1, 0 });
53
vBufferColumn[index] = new
VBuffer
<int>(5, originalValues);
Microsoft.ML.AutoML (2)
Sweepers\SmacSweeper.cs (1)
334
VBuffer<Float> features = new
VBuffer
<Float>(transformedParams.Length, transformedParams);
Tuner\SmacTuner.cs (1)
325
var features = new
VBuffer
<float>(transformedParams.Length, transformedParams);
Microsoft.ML.Core (2)
Utilities\VBufferUtils.cs (2)
70
return new
VBuffer
<T>(length, 0, null, null);
76
return new
VBuffer
<T>(length, new T[length]);
Microsoft.ML.Core.Tests (29)
UnitTests\ScoreSchemaTest.cs (1)
74
var actualKeyNames = new
VBuffer
<ReadOnlyMemory<char>>();
UnitTests\TestVBuffer.cs (28)
36
var buffer = new
VBuffer
<float>(10, 3, new[] { 0.5f, 1.2f, -3.8f }, new[] { 1, 5, 8 });
142
a = new
VBuffer
<float>(length, values, indicies);
145
VBuffer<float> a2DenseVbuff = new
VBuffer
<float>(length, a2Values);
150
var vbufMultExpected = new
VBuffer
<float>(length, multResExpected);
165
a = new
VBuffer
<float>(length, values, indicies);
168
VBuffer<float> a2DenseVbuff = new
VBuffer
<float>(length, a2Values);
173
var vbufMultExpected = new
VBuffer
<float>(length, multResExpected);
181
var a = new
VBuffer
<float>(5, new float[5] { 1, 2, 3, 4, 5 });
185
VBuffer<float> a2 = new
VBuffer
<float>(length, a2Values);
190
var vbufMultExpected = new
VBuffer
<float>(5, 2, multResExpected, new int[2] { 3, 4 });
191
var multResActual = new
VBuffer
<float>(length, new float[length]);
200
var a = new
VBuffer
<float>(5, new float[5] { 1, 2, 3, 4, 5 });
204
VBuffer<float> a2 = new
VBuffer
<float>(length, a2Values);
211
var vbufMultExpected = new
VBuffer
<float>(5, 4, multResExpected, new int[4] { 0, 1, 3, 4 });
223
var a = new
VBuffer
<float>(7, 6, new float[6] { 10, 20, 40, 50, 60, -70 },
229
VBuffer<float> a2 = new
VBuffer
<float>(length, a2Values);
239
var vbufMultExpected = new
VBuffer
<float>(7, 3, multResExpected, new int[3] { 4, 5, 6 });
252
var a = new
VBuffer
<float>(7, 6, new float[6] { 100, 20, 40, 50, 60, 70 },
254
var b = new
VBuffer
<float>(7, 6, new float[6] { 100, 20, 30, 40, 50, 70 },
265
var vbufMultExpected = new
VBuffer
<float>(7, 2, multResExpected, new int[2] { 0, 6 });
285
var a = new
VBuffer
<float>(10, values);
309
var a = new
VBuffer
<float>(10, values);
340
b = new
VBuffer
<T2>(a.Length, indices.Length, values, indices);
382
b = new
VBuffer
<T2>(a.Length, indices.Length, values, indices);
478
dst = new
VBuffer
<TDst>(a.Length, indices.Count, values, indices.ToArray());
514
dst = new
VBuffer
<TDst>(a.Length, indices.Length, values, indices);
935
var expectedVector = new
VBuffer
<float>(Math.Max(1, expectedLength),
991
dst = new
VBuffer
<float>(len, count, values, indices);
Microsoft.ML.Data (32)
DataLoadSave\FakeSchema.cs (1)
61
ValueGetter<VBuffer<TValue>> getter = (ref VBuffer<TValue> value) => value = new
VBuffer
<TValue>(AllVectorSizes, 0, null, null);
DataView\Transposer.cs (3)
407
cached = new
VBuffer
<T>(len, count, values, count == len ? null : indices);
409
(new
VBuffer
<T>(len, count, values, indices)).CopyToDense(ref cached);
662
var temp = new
VBuffer
<T>(_len, count, values, indices);
Evaluators\BinaryClassifierEvaluator.cs (2)
184
labelNames = new
VBuffer
<ReadOnlyMemory<char>>(2, new[] { "positive".AsMemory(), "negative".AsMemory() });
363
dst = new
VBuffer
<ReadOnlyMemory<char>>(aggregator.ClassNames.Length, aggregator.ClassNames);
Evaluators\EvaluatorUtils.cs (4)
494
var reconciledSlotNames = new
VBuffer
<ReadOnlyMemory<char>>(slotNames.Count, slotNames.Keys.Select(k => k.AsMemory()).ToArray());
615
var keyNamesVBuffer = new
VBuffer
<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray());
683
var keyNamesVBuffer = new
VBuffer
<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray());
1312
var slotNames = new
VBuffer
<ReadOnlyMemory<char>>(type.Size, names);
Evaluators\MulticlassClassificationEvaluator.cs (2)
226
dst = new
VBuffer
<ReadOnlyMemory<char>>(allTopK.First().Length, Enumerable.Range(1, allTopK.First().Length).Select(i => new ReadOnlyMemory<char>(i.ToString().ToCharArray())).ToArray());
240
dst = new
VBuffer
<ReadOnlyMemory<char>>(aggregator.ClassNames.Length, aggregator.ClassNames);
Evaluators\QuantileRegressionEvaluator.cs (5)
105
return new
VBuffer
<Double>(_size, res);
119
return new
VBuffer
<Double>(_size, res);
225
Score = new
VBuffer
<float>(size, 0, null, null);
226
Loss = new
VBuffer
<Double>(size, 0, null, null);
313
_quantiles = new
VBuffer
<ReadOnlyMemory<char>>(quantiles.Length, quantiles);
Transforms\ColumnConcatenatingTransformer.cs (1)
615
dst = new
VBuffer
<int>(allValues.Count, allValues.ToArray());
Transforms\InvertHashUtils.cs (2)
253
return new
VBuffer
<ReadOnlyMemory<char>>((int)_slots, count, values, indices);
264
return new
VBuffer
<ReadOnlyMemory<char>>(values.Length, values);
Transforms\KeyToVector.cs (1)
446
dst = new
VBuffer
<int>(ranges.Length, ranges);
Transforms\NormalizeColumn.cs (4)
507
var src = new
VBuffer
<TFloat>(Scale.Length, Scale);
514
var src = new
VBuffer
<TFloat>(Offset.Length, Offset);
627
var src = new
VBuffer
<TFloat>(Mean.Length, Mean);
633
var src = new
VBuffer
<TFloat>(Stddev.Length, Stddev);
Transforms\NormalizeColumnDbl.cs (3)
1531
_buffer = new
VBuffer
<TFloat>(1, new TFloat[1]);
1662
_buffer = new
VBuffer
<TFloat>(1, new TFloat[1]);
2068
_buffer = new
VBuffer
<double>(1, new double[1]);
Transforms\NormalizeColumnSng.cs (3)
1694
_buffer = new
VBuffer
<TFloat>(1, new TFloat[1]);
1825
_buffer = new
VBuffer
<TFloat>(1, new TFloat[1]);
2232
_buffer = new
VBuffer
<TFloat>(1, new TFloat[1]);
Transforms\SlotsDroppingTransformer.cs (1)
702
dst = new
VBuffer
<int>(newCategoricalSlotRanges.Count, newCategoricalSlotRanges.ToArray());
Microsoft.ML.DataView (2)
VBufferEditor.cs (2)
136
return new
VBuffer
<T>(_logicalLength, Values.Length, _values, _indices);
163
return new
VBuffer
<T>(_logicalLength, physicalValuesCount, _values, _indices);
Microsoft.ML.FastTree (8)
Utils\RegressionTreeBaseUtils.cs (8)
85
categoricalSplitFeatures.Add(new
VBuffer
<int>(categoricalSplitFeaturesArray.Length, categoricalSplitFeaturesArray));
90
categoricalCategoricalSplitFeatureRange.Add(new
VBuffer
<int>(categoricalCategoricalSplitFeatureRangeArray.Length, categoricalCategoricalSplitFeatureRangeArray));
94
categoricalSplitFeatures.AddRange(Enumerable.Repeat(new
VBuffer
<int>(), trees[i].NumberOfLeaves));
95
categoricalCategoricalSplitFeatureRange.AddRange(Enumerable.Repeat(new
VBuffer
<int>(), trees[i].NumberOfLeaves));
124
leafSamples.AddRange(Enumerable.Repeat(new
VBuffer
<double>(), quantileTrees[i].NumberOfNodes));
125
leafSampleWeights.AddRange(Enumerable.Repeat(new
VBuffer
<double>(), quantileTrees[i].NumberOfNodes));
129
leafSamples.Add(new
VBuffer
<double>(leafSamplesArray.Length, leafSamplesArray));
133
leafSampleWeights.Add(new
VBuffer
<double>(leafSampleWeightsArray.Length, leafSampleWeightsArray));
Microsoft.ML.ImageAnalytics (1)
ImageLoader.cs (1)
314
imgData = new
VBuffer
<byte>(count, imageBuffer);
Microsoft.ML.IntegrationTests (3)
Explainability.cs (2)
128
var weights = new
VBuffer
<float>();
155
var weights = new
VBuffer
<float>();
IntrospectiveTraining.cs (1)
351
VBuffer<ReadOnlyMemory<char>> categoricalSlotNames = new
VBuffer
<ReadOnlyMemory<char>>();
Microsoft.ML.Mkl.Components (2)
ComputeLRTrainingStdThroughHal.cs (1)
92
return new
VBuffer
<float>(currentWeightsCount, numSelectedParams, stdErrorValues, weightIndices);
OlsLinearRegression.cs (1)
445
var weights = new
VBuffer
<float>(weightsValues.Length, weightsValues);
Microsoft.ML.Parquet (2)
ParquetLoader.cs (2)
691
public void Conv(in byte[] src, ref VBuffer<Byte> dst) => dst = src != null ? new
VBuffer
<byte>(src.Length, src) : new
VBuffer
<byte>(0, new byte[0]);
Microsoft.ML.PCA (1)
PcaTrainer.cs (1)
462
_eigenVectors[i] = new
VBuffer
<float>(eigenVectors[i].Length, eigenVectors[i]);
Microsoft.ML.PerformanceTests (1)
HashBench.cs (1)
129
var vbuf = new
VBuffer
<T>(vals.Length, vals);
Microsoft.ML.Predictor.Tests (4)
TestTransposer.cs (4)
119
vecs[r] = new
VBuffer
<T>(slotCount, vals);
133
vecs[r] = new
VBuffer
<T>(slotCount, indices.Count, vals, indices.ToArray());
160
dataA[rowCount / 2] = new
VBuffer
<int>(50, 0, null, null); // Coverage for the null vbuffer case.
226
dataA[rowCount / 2] = new
VBuffer
<int>(50, 0, null, null); // Coverage for the null vbuffer case.
Microsoft.ML.Samples (2)
Dynamic\Transforms\Conversion\Hash.cs (1)
79
var slotNames = new
VBuffer
<ReadOnlyMemory<char>>();
Dynamic\Transforms\Conversion\HashWithOptions.cs (1)
93
var slotNames = new
VBuffer
<ReadOnlyMemory<char>>();
Microsoft.ML.StandardTrainers (12)
FactorizationMachine\FactorizationMachineTrainer.cs (1)
458
var featureBuffer = new
VBuffer
<float>();
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (1)
102
var featureBuffer = new
VBuffer
<float>();
Optimizer\DifferentiableFunction.cs (3)
214
VBuffer<float> dir = new
VBuffer
<float>(x.Length, values.Count, values.ToArray(), indices.ToArray());
262
VBuffer<float> dir = new
VBuffer
<float>(x.Length, 1, new float[] { 1 }, new int[] { 0 });
301
VBuffer<float> dir = new
VBuffer
<float>(x.Length, 1, new float[] { 1 }, new int[] { 0 });
Standard\LogisticRegression\LbfgsPredictorBase.cs (3)
332
init = new
VBuffer
<float>(initWeights.Length, initWeights);
560
CurrentWeights = new
VBuffer
<float>(betaArray.Length, betaArray);
913
return new
VBuffer
<float>(initWeights.Length, initWeights);
Standard\ModelStatistics.cs (2)
281
_coeffStdError = new
VBuffer
<float>(length, stdErrorValues);
287
_coeffStdError = new
VBuffer
<float>(length, ParametersCount, stdErrorValues, stdErrorIndices);
Standard\Online\OnlineLinear.cs (2)
158
Weights = new
VBuffer
<float>(numFeatures, weightValues);
166
Weights = new
VBuffer
<float>(numFeatures, weightValues);
Microsoft.ML.Sweeper (1)
Algorithms\SmacSweeper.cs (1)
344
VBuffer<float> features = new
VBuffer
<float>(transformedParams.Length, transformedParams);
Microsoft.ML.TestFramework (12)
DataPipe\TestDataPipe.cs (8)
27
private static VBuffer<Single> _dataFloatSparse = new
VBuffer
<Single>(5, 3, new float[] { -0.0f, 0, 1 }, new[] { 0, 3, 4 });
34
private static VBuffer<Double> _dataDoubleSparse = new
VBuffer
<Double>(5, 3, new double[] { -0.0, 0, 1 }, new[] { 0, 3, 4 });
915
expected[0] = new
VBuffer
<ReadOnlyMemory<char>>(values.Length, values);
917
expected[1] = new
VBuffer
<ReadOnlyMemory<char>>(values1.Length, values1);
1151
VBuffer<uint> resultRow = new
VBuffer
<uint>();
1558
VBuffer<float> resultFirstRow = new
VBuffer
<float>();
1559
VBuffer<float> resultSecondRow = new
VBuffer
<float>();
1560
VBuffer<float> resultThirdRow = new
VBuffer
<float>();
TestSparseDataView.cs (4)
47
new SparseExample<T>() { X = new
VBuffer
<T> (5, 3, v1, new int[] { 0, 2, 4 }) },
48
new SparseExample<T>() { X = new
VBuffer
<T> (5, 3, v2, new int[] { 0, 1, 3 }) }
52
var value = new
VBuffer
<T>();
92
var value = new
VBuffer
<T>();
Microsoft.ML.Tests (47)
FeatureContributionTests.cs (2)
278
vb = new
VBuffer
<float>(4, 3, new float[] { rand.Next(1000), rand.Next(1000), rand.Next(1000) }, new int[] { 0, 2, 3 });
282
vb = new
VBuffer
<float>(4, 4, new float[] { rand.Next(1000), rand.Next(1000), rand.Next(1000), rand.Next(1000) }, new int[] { 0, 1, 2, 3 });
PermutationFeatureImportanceTests.cs (2)
902
vb = new
VBuffer
<float>(4, 3, new float[] { rand.Next(1000), rand.Next(1000), rand.Next(1000) }, new int[] { 0, 2, 3 });
906
vb = new
VBuffer
<float>(4, 4, new float[] { rand.Next(1000), rand.Next(1000), rand.Next(1000), rand.Next(1000) }, new int[] { 0, 1, 2, 3 });
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
434
var weights = new
VBuffer
<float>();
Scenarios\Api\TestApi.cs (5)
216
var valueVBuffer = new
VBuffer
<float>(4, new float[] { 4, 6, 89, 5 });
250
VBuffer<ReadOnlyMemory<char>> retrievedReadOnlyMemoryVBuffer = new
VBuffer
<ReadOnlyMemory<char>>();
254
VBuffer<float> retrievedFloatVBuffer = new
VBuffer
<float>(1, new float[] { 2 });
256
VBuffer<float> valueFloatVBuffer = new
VBuffer
<float>(valueFloatArray.Length, valueFloatArray);
259
VBuffer<float> retrievedVBuffer = new
VBuffer
<float>();
SvmLightTests.cs (33)
79
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(5, 2, new[] { 3f, 6f }, new[] { 0, 3 }) },
80
new SvmLightOutput() { Label = -1, Weight = 5, Features = new
VBuffer
<float>(5, 2, new[] { 4f, 7f }, new[] { 1, 3 }) },
81
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(5, 1, new[] { -2f }, new[] { 4 }), Comment = " A comment! 2:3".AsMemory() },
82
new SvmLightOutput() { Label = 1, Weight = 0.5f, Features = new
VBuffer
<float>(5, 1, new[] { 3.14159f }, new[] { 1 }) },
107
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(5, 2, new[] { 3f, 6f }, new[] { 1, 4 }) },
108
new SvmLightOutput() { Label = -1, Weight = 5, Features = new
VBuffer
<float>(5, 2, new[] { 4f, 7f }, new[] { 2, 4 }) },
109
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(5, 0, new float[0], new int[0]), Comment = " A comment! 2:3".AsMemory() },
110
new SvmLightOutput() { Label = 1, Weight = 0.5f, Features = new
VBuffer
<float>(5, 1, new[] { 3.14159f }, new[] { 2 }) },
136
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 2, new[] { 3f, 6f }, new[] { 0, 3 }) },
137
new SvmLightOutput() { Label = -1, Weight = 5, Features = new
VBuffer
<float>(6, 3, new[] { 4f, 7f, -1f }, new[] { 1, 3, 5 }) },
138
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { -2f }, new[] { 4 }), Comment = " A comment! 2:3".AsMemory() },
139
new SvmLightOutput() { Label = 1, Weight = 0.5f, Features = new
VBuffer
<float>(6, 1, new[] { 3.14159f }, new[] { 1 }) },
162
AnnotationUtils.Kinds.SlotNames, new
VBuffer
<ReadOnlyMemory<char>>(3, new[] { "aurora".AsMemory(), "beachwood".AsMemory(), "chagrin".AsMemory() }),
166
new SvmLightOutput() { Label = 1, Weight = 1, GroupId = 1, Features = new
VBuffer
<float>(3, 2, new[] { 3.14159f, 123f }, new[] { 0, 1 }) },
167
new SvmLightOutput() { Label = -1, Weight = 1, GroupId = 5, Features = new
VBuffer
<float>(3, 2, new[] { 345f, -21f }, new[] { 1, 2 }) },
190
new SvmLightOutput() { Label = -1, Weight = 1, Features = new
VBuffer
<float>(3, 2, new[] { 1f, 2f }, new[] { 0, 2 }) },
191
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(3, 1, new[] { 3f }, new[] { 2 }) },
214
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(1, 1, new[] { 2f }, new[] { 0 }) },
309
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 2, new[] { 3f, 6f }, new[] { 0, 3 }) },
310
new SvmLightOutput() { Label = -1, Weight = 5, Features = new
VBuffer
<float>(6, 3, new[] { 4f, 7f, -1f }, new[] { 1, 3, 5 }) },
311
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { -2f }, new[] { 4 }), Comment = " A comment! 2:3".AsMemory() },
312
new SvmLightOutput() { Label = 1, Weight = 0.5f, Features = new
VBuffer
<float>(6, 1, new[] { 3.14159f }, new[] { 1 }) },
313
new SvmLightOutput() { Label = -1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { 2f }, new[] { 2 }) },
466
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 2, new[] { 3f, 6f }, new[] { 0, 3 }) },
467
new SvmLightOutput() { Label = -1, Weight = 5, Features = new
VBuffer
<float>(6, 3, new[] { 4f, 7f, -1f }, new[] { 1, 3, 5 }) },
468
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { -2f }, new[] { 4 }), Comment = " A comment! 2:3".AsMemory() },
469
new SvmLightOutput() { Label = 1, Weight = 0.5f, Features = new
VBuffer
<float>(6, 1, new[] { 3.14159f }, new[] { 1 }) },
470
new SvmLightOutput() { Label = -1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { 5f }, new[] { 1 }) }
493
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 2, new[] { 3f, 6f }, new[] { 0, 3 }) },
494
new SvmLightOutput() { Label = -1, Weight = 5, Features = new
VBuffer
<float>(6, 3, new[] { 4f, 7f, -1f }, new[] { 1, 3, 5 }) },
495
new SvmLightOutput() { Label = 1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { -2f }, new[] { 4 }), Comment = " A comment! 2:3".AsMemory() },
496
new SvmLightOutput() { Label = 1, Weight = 0.5f, Features = new
VBuffer
<float>(6, 1, new[] { 3.14159f }, new[] { 1 }) },
497
new SvmLightOutput() { Label = -1, Weight = 1, Features = new
VBuffer
<float>(6, 1, new[] { 5f }, new[] { 1 }) }
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (3)
166
var leafId = model.Model.SubModel.GetLeaf(treeIndex, new
VBuffer
<float>(10, features[dataPointIndex]), ref path);
217
var leafId = model.Model.GetLeaf(treeIndex, new
VBuffer
<float>(10, features[dataPointIndex]), ref path);
281
var leafId = model.Model.SubModel.GetLeaf(treeIndex, new
VBuffer
<float>(10, features[dataPointIndex]), ref path);
Transformers\NAIndicatorTests.cs (1)
145
var value = new
VBuffer
<ReadOnlyMemory<char>>();
Microsoft.ML.TimeSeries (9)
SequentialAnomalyDetectionTransformBase.cs (1)
325
_slotNames = new
VBuffer
<ReadOnlyMemory<char>>(4, new[] { "Alert".AsMemory(), "Raw Score".AsMemory(),
SrCnnTransformBase.cs (1)
168
_slotNames = new
VBuffer
<ReadOnlyMemory<char>>(_parent.OutputLength, new[] { "Alert".AsMemory(), "Raw Score".AsMemory(),
SsaForecastingBase.cs (7)
266
dst = new
VBuffer
<float>(LocalHorizon ?? _parentForecaster.Horizon,
281
dst1 = new
VBuffer
<float>(_parentForecaster.Horizon, forecast);
282
dst2 = new
VBuffer
<float>(_parentForecaster.Horizon, min);
283
dst3 = new
VBuffer
<float>(_parentForecaster.Horizon, max);
289
dst = new
VBuffer
<float>(horizon, ((AdaptiveSingularSpectrumSequenceModelerInternal)_model).Forecast(horizon));
298
dst = new
VBuffer
<float>(horizon, min);
307
dst = new
VBuffer
<float>(horizon, max);
Microsoft.ML.TorchSharp (1)
NasBert\NerTrainer.cs (1)
131
VBuffer<long> t = new
VBuffer
<long>(target.Length + 1, tl.ToArray());
Microsoft.ML.Transforms (9)
CountFeatureSelection.cs (1)
394
_buffer = new
VBuffer
<T>(1, new T[1]);
Dracula\CountTableTransformer.cs (1)
644
inputSlotNames = new
VBuffer
<ReadOnlyMemory<char>>(1, new[] { inputCol.Name.AsMemory() });
MissingValueReplacing.cs (1)
482
return new
VBuffer
<T>(array.Length, array);
PermutationFeatureImportance.cs (1)
105
weights = new
VBuffer
<float>(numSlots, count, values, indexes);
RandomFourierFeaturizing.cs (2)
316
dst = new
VBuffer
<float>(1, new[] { val });
537
var oneDimensionalVector = new
VBuffer
<float>(1, new float[] { 0 });
SvmLight\SvmLightLoader.cs (2)
240
intermediate.FeatureKeys = new
VBuffer
<ReadOnlyMemory<char>>(keys.Count, keys.ToArray());
241
intermediate.FeatureValues = new
VBuffer
<float>(values.Count, values.ToArray());
Text\NgramTransform.cs (1)
530
var unigramNames = new
VBuffer
<ReadOnlyMemory<char>>();
2977 references to VBuffer
DnnAnalyzer (1)
DnnAnalyzer.cs (1)
44
VBuffer
<ReadOnlyMemory<char>> inputOps = default;
Microsoft.Data.Analysis (27)
DataFrameColumns\VBufferDataFrameColumn.cs (27)
18
public partial class VBufferDataFrameColumn<T> : DataFrameColumn, IEnumerable<
VBuffer
<T>>
20
public static int MaxCapacity = ArrayUtility.ArrayMaxSize / Unsafe.SizeOf<
VBuffer
<T>>();
22
private readonly List<List<
VBuffer
<T>>> _vBuffers = new List<List<
VBuffer
<T>>>(); // To store more than intMax number of vbuffers
29
public VBufferDataFrameColumn(string name, long length = 0) : base(name, length, typeof(
VBuffer
<T>))
35
List<
VBuffer
<T>> buffer = new List<
VBuffer
<T>>(bufferLen);
44
public VBufferDataFrameColumn(string name, IEnumerable<
VBuffer
<T>> values) : base(name, 0, typeof(
VBuffer
<T>))
49
_vBuffers.Add(new List<
VBuffer
<T>>());
51
foreach (
var
value in values)
70
public void Append(
VBuffer
<T> value)
72
List<
VBuffer
<T>> lastBuffer = _vBuffers[_vBuffers.Count - 1];
75
lastBuffer = new List<
VBuffer
<T>>();
97
protected
VBuffer
<T> GetTypedValue(long rowIndex)
126
else if (value is
VBuffer
<T> vbuffer)
132
throw new ArgumentException(string.Format(Strings.MismatchedValueType, typeof(
VBuffer
<T>)), nameof(value));
136
protected void SetTypedValue(long rowIndex,
VBuffer
<T> value)
142
public new
VBuffer
<T> this[long rowIndex]
151
public IEnumerator<
VBuffer
<T>> GetEnumerator()
153
foreach (List<
VBuffer
<T>> buffer in _vBuffers)
155
foreach (
VBuffer
<T> value in buffer)
177
private ValueGetter<
VBuffer
<T>> CreateValueGetterDelegate(DataViewRowCursor cursor) =>
178
(ref
VBuffer
<T> value) => value = this[cursor.Position];
187
return cursor.GetGetter<
VBuffer
<T>>(schemaColumn);
193
VBuffer
<T> value = default;
196
(getter as ValueGetter<
VBuffer
<T>>)(ref value);
Microsoft.Data.Analysis.Tests (3)
DataFrameIDataViewTests.cs (2)
246
Assert.True(preview.ColumnView[16].Values[0] is
VBuffer
<int>);
247
Assert.True(preview.ColumnView[16].Values[6] is
VBuffer
<int>);
VBufferColumnTests.cs (1)
33
var
buffer = new VBuffer<int>(5, new[] { 4, 3, 2, 1, 0 });
Microsoft.ML.AutoML (14)
AutoMLExperiment\ITrialResultManager.cs (2)
156
var parameterGetter = rowCursor.GetGetter<
VBuffer
<double>>(_schema["parameter"]);
165
VBuffer
<double> parameter = default;
ColumnInference\ColumnTypeInference.cs (3)
279
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> vecGetter = null;
282
if (isVector) { vecGetter = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(column); }
288
VBuffer
<ReadOnlyMemory<char>> line = default;
ColumnInference\TextFileContents.cs (2)
100
var getter = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(column);
102
VBuffer
<ReadOnlyMemory<char>> line = default;
DatasetDimensions\DatasetDimensionsUtil.cs (3)
53
var getter = cursor.GetGetter<
VBuffer
<Single>>(column);
54
var
value = default(
VBuffer
<Single>);
Sweepers\SmacSweeper.cs (2)
334
VBuffer
<Float> features = new VBuffer<Float>(transformedParams.Length, transformedParams);
350
private static int GetLeaf(TreeEnsembleModelParameters model, int treeId,
VBuffer
<Float> features)
TrainerExtensions\MultiTrainerExtensions.cs (1)
70
LightGbmMulticlassTrainer.Options options = TrainerExtensionUtil.CreateLightGbmOptions<LightGbmMulticlassTrainer.Options,
VBuffer
<float>, MulticlassPredictionTransformer<OneVersusAllModelParameters>, OneVersusAllModelParameters>(sweepParams, columnInfo);
Tuner\SmacTuner.cs (1)
325
var
features = new VBuffer<float>(transformedParams.Length, transformedParams);
Microsoft.ML.AutoML.Tests (2)
Util.cs (2)
24
public static ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> GetKeyValueGetter(IEnumerable<string> colNames)
26
return (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Microsoft.ML.Core (48)
Data\AnnotationBuilderExtensions.cs (2)
18
public static void AddSlotNames(this DataViewSchema.Annotations.Builder builder, int size, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter)
29
public static void AddKeyValues<TValue>(this DataViewSchema.Annotations.Builder builder, int size, PrimitiveDataViewType valueType, ValueGetter<
VBuffer
<TValue>> getter)
Data\AnnotationUtils.cs (4)
298
public static void GetSlotNames(RoleMappedSchema schema, RoleMappedSchema.ColumnRole role, int vectorSize, ref
VBuffer
<ReadOnlyMemory<char>> slotNames)
389
if (type?.RawType == typeof(
VBuffer
<int>))
391
VBuffer
<int> catIndices = default(
VBuffer
<int>);
Utilities\VBufferUtils.cs (42)
16
/// Convenience utilities for vector operations on <see cref="
VBuffer
{T}"/>.
23
public static bool HasNaNs(in
VBuffer
<Single> buffer)
34
public static bool HasNaNs(in
VBuffer
<Double> buffer)
45
public static bool HasNonFinite(in
VBuffer
<Single> buffer)
56
public static bool HasNonFinite(in
VBuffer
<Double> buffer)
67
public static
VBuffer
<T> CreateEmpty<T>(int length)
73
public static
VBuffer
<T> CreateDense<T>(int length)
83
public static void ForEachDefined<T>(in
VBuffer
<T> a, Action<int, T> visitor)
107
/// <see cref="
VBuffer
{T}.GetValues"/> corresponding to that index.
113
public static void ForEachBothDefined<T>(in
VBuffer
<T> a, in
VBuffer
<T> b, Action<int, T, T> visitor)
164
public static void ForEachEitherDefined<T>(in
VBuffer
<T> a, in
VBuffer
<T> b, Action<int, T, T> visitor)
243
public static void Clear<T>(ref
VBuffer
<T> dst)
270
public static void Apply<T>(ref
VBuffer
<T> dst, SlotValueManipulator<T> manip)
302
public static void ApplyAt<T>(ref
VBuffer
<T> dst, int slot, SlotValueManipulator<T> manip, ValuePredicate<T> pred = null)
354
public static void Densify<T>(ref
VBuffer
<T> dst)
399
public static void DensifyFirst<T>(ref
VBuffer
<T> dst, int denseCount)
448
public static void CreateMaybeSparseCopy<T>(in
VBuffer
<T> src, ref
VBuffer
<T> dst, InPredicate<T> isDefaultPredicate, float sparsityThreshold = SparsityThreshold)
524
public static void ApplyWith<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, PairManipulator<TSrc, TDst> manip)
544
public static void ApplyWithCopy<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, ref
VBuffer
<TDst> res, PairManipulatorCopy<TSrc, TDst> manip)
560
public static void ApplyWithEitherDefined<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, PairManipulator<TSrc, TDst> manip)
578
public static void ApplyWithEitherDefinedCopy<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, ref
VBuffer
<TDst> res, PairManipulatorCopy<TSrc, TDst> manip)
589
private static void ApplyWithCore<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, PairManipulator<TSrc, TDst> manip, bool outer)
876
private static void ApplyWithCoreCopy<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, ref
VBuffer
<TDst> res, PairManipulatorCopy<TSrc, TDst> manip, bool outer)
1125
public static void ApplyIntoEitherDefined<TSrc, TDst>(in
VBuffer
<TSrc> src, ref
VBuffer
<TDst> dst, Func<int, TSrc, TDst> func)
1167
public static void ApplyInto<TSrc1, TSrc2, TDst>(in
VBuffer
<TSrc1> a, in
VBuffer
<TSrc2> b, ref
VBuffer
<TDst> dst, Func<int, TSrc1, TSrc2, TDst> func)
1351
public static void Copy<T>(List<T> src, ref
VBuffer
<T> dst, int length)
1370
public static void Resize<T>(ref
VBuffer
<T> dst, int newLogicalLength, int? valuesCount = null)
Microsoft.ML.Core.Tests (226)
UnitTests\CoreBaseTestClass.cs (6)
70
var g1 = r1.GetGetter<
VBuffer
<T>>(r1.Schema[col]);
71
var g2 = r2.GetGetter<
VBuffer
<T>>(r2.Schema[col]);
72
var
v1 = default(
VBuffer
<T>);
73
var
v2 = default(
VBuffer
<T>);
UnitTests\ScoreSchemaTest.cs (6)
19
private
VBuffer
<ReadOnlyMemory<char>> GenerateKeyNames(int keyCount)
22
VBuffer
<ReadOnlyMemory<char>> buffer = default;
38
VBuffer
<ReadOnlyMemory<char>> keyNames = GenerateKeyNames(keyCount);
73
var keyNamesGetter = scoreMetadata.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(scoreMetadata.Schema[0]);
74
var
actualKeyNames = new VBuffer<ReadOnlyMemory<char>>();
95
VBuffer
<ReadOnlyMemory<char>> keyNames = GenerateKeyNames(0);
UnitTests\TestEntryPoints.cs (50)
2070
var getter0 = curs0.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2073
var getter1 = curs1.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2076
var getter2 = curs2.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2079
var getter3 = curs3.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2082
var getter4 = curs4.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2085
var getter = curs.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2088
var getterSaved = cursSaved.GetGetter<
VBuffer
<Single>>(scoreColumn.Value);
2091
VBuffer
<Single> score = default(
VBuffer
<Single>);
2092
VBuffer
<Single>[] score0 = new
VBuffer
<Single>[5];
2093
VBuffer
<Single> scoreSaved = default(
VBuffer
<Single>);
2094
VBuffer
<Single> avg = default(
VBuffer
<Single>);
2095
VBuffer
<Single> dense1 = default(
VBuffer
<Single>);
2096
VBuffer
<Single> dense2 = default(
VBuffer
<Single>);
2264
private static bool CompareVBuffers(in
VBuffer
<Single> v1, in
VBuffer
<Single> v2, ref
VBuffer
<Single> dense1, ref
VBuffer
<Single> dense2)
4490
VBuffer
<float> treeValues = default(
VBuffer
<float>);
4491
VBuffer
<float> leafIndicators = default(
VBuffer
<float>);
4492
VBuffer
<float> pathIndicators = default(
VBuffer
<float>);
4495
var treesGetter = curs.GetGetter<
VBuffer
<float>>(treesCol.Value);
4496
var leavesGetter = curs.GetGetter<
VBuffer
<float>>(leavesCol.Value);
4497
var pathsGetter = curs.GetGetter<
VBuffer
<float>>(pathsCol.Value);
4546
var featGetter = cursor.GetGetter<
VBuffer
<float>>(featColumn.Value);
4547
VBuffer
<float> feat = default;
5408
var
slotNames = default(
VBuffer
<ReadOnlyMemory<char>>);
5417
var countGetter = curs.GetGetter<
VBuffer
<double>>(countCol.Value);
5419
var
confCount = default(
VBuffer
<double>);
6072
var getter = cursor.GetGetter<
VBuffer
<double>>(metricCol.Value);
6079
var
avg = default(
VBuffer
<double>);
6087
var
stdev = default(
VBuffer
<double>);
6098
var
val = default(
VBuffer
<double>);
6108
var
sum = default(
VBuffer
<double>);
6881
var ndcgGetter = cursor.GetGetter<
VBuffer
<Double>>(data.Schema["NDCG"]);
6882
VBuffer
<Double> ndcgBuffer = default;
UnitTests\TestVBuffer.cs (164)
36
var
buffer = new VBuffer<float>(10, 3, new[] { 0.5f, 1.2f, -3.8f }, new[] { 1, 5, 8 });
46
VBuffer
<float> a = default;
47
VBuffer
<float> actualDst = default;
48
VBuffer
<float> dst = default;
67
VBuffer
<float> a = default(
VBuffer
<float>);
68
VBuffer
<float> actualDst = default(
VBuffer
<float>);
69
VBuffer
<float> dst = default(
VBuffer
<float>);
89
VBuffer
<float> a;
90
VBuffer
<float> aOrig = default(
VBuffer
<float>);
135
VBuffer
<float> a;
145
VBuffer
<float> a2DenseVbuff = new VBuffer<float>(length, a2Values);
150
var
vbufMultExpected = new VBuffer<float>(length, multResExpected);
158
VBuffer
<float> a;
168
VBuffer
<float> a2DenseVbuff = new VBuffer<float>(length, a2Values);
173
var
vbufMultExpected = new VBuffer<float>(length, multResExpected);
181
var
a = new VBuffer<float>(5, new float[5] { 1, 2, 3, 4, 5 });
185
VBuffer
<float> a2 = new VBuffer<float>(length, a2Values);
190
var
vbufMultExpected = new VBuffer<float>(5, 2, multResExpected, new int[2] { 3, 4 });
191
var
multResActual = new VBuffer<float>(length, new float[length]);
200
var
a = new VBuffer<float>(5, new float[5] { 1, 2, 3, 4, 5 });
204
VBuffer
<float> a2 = new VBuffer<float>(length, a2Values);
211
var
vbufMultExpected = new VBuffer<float>(5, 4, multResExpected, new int[4] { 0, 1, 3, 4 });
223
var
a = new VBuffer<float>(7, 6, new float[6] { 10, 20, 40, 50, 60, -70 },
229
VBuffer
<float> a2 = new VBuffer<float>(length, a2Values);
239
var
vbufMultExpected = new VBuffer<float>(7, 3, multResExpected, new int[3] { 4, 5, 6 });
252
var
a = new VBuffer<float>(7, 6, new float[6] { 100, 20, 40, 50, 60, 70 },
254
var
b = new VBuffer<float>(7, 6, new float[6] { 100, 20, 30, 40, 50, 70 },
265
var
vbufMultExpected = new VBuffer<float>(7, 2, multResExpected, new int[2] { 0, 6 });
285
var
a = new VBuffer<float>(10, values);
309
var
a = new VBuffer<float>(10, values);
323
private static void NaiveApplyWith<T1, T2>(ref
VBuffer
<T1> a, ref
VBuffer
<T2> b, VBufferUtils.PairManipulator<T1, T2> manip)
347
VBuffer
<float> a = default(
VBuffer
<float>);
348
VBuffer
<float> b = default(
VBuffer
<float>);
349
VBuffer
<float> aOrig = default(
VBuffer
<float>);
350
VBuffer
<float> bOrig = default(
VBuffer
<float>);
370
private static void NaiveApplyWithEither<T1, T2>(ref
VBuffer
<T1> a, ref
VBuffer
<T2> b, VBufferUtils.PairManipulator<T1, T2> manip)
389
VBuffer
<float> a = default(
VBuffer
<float>);
390
VBuffer
<float> b = default(
VBuffer
<float>);
391
VBuffer
<float> aOrig = default(
VBuffer
<float>);
392
VBuffer
<float> bOrig = default(
VBuffer
<float>);
393
VBuffer
<float> dst = default(
VBuffer
<float>);
415
private static void NaiveForEach<T1, T2>(ref
VBuffer
<T1> a, ref
VBuffer
<T2> b, Action<int, T1, T2> vis, bool union)
434
VBuffer
<float> a = default(
VBuffer
<float>);
435
VBuffer
<float> b = default(
VBuffer
<float>);
469
private static void NaiveApplyInto<T, TDst>(ref
VBuffer
<T> a, ref
VBuffer
<TDst> dst, Func<int, T, TDst> func)
485
VBuffer
<float> a = default(
VBuffer
<float>);
486
VBuffer
<float> actualDst = default(
VBuffer
<float>);
487
VBuffer
<float> dst = default(
VBuffer
<float>);
501
private static void NaiveApplyInto<T1, T2, TDst>(ref
VBuffer
<T1> a, ref
VBuffer
<T2> b, ref
VBuffer
<TDst> dst, Func<int, T1, T2, TDst> func)
521
VBuffer
<float> a = default(
VBuffer
<float>);
522
VBuffer
<float> b = default(
VBuffer
<float>);
523
VBuffer
<float> actualDst = default(
VBuffer
<float>);
524
VBuffer
<float> dst = default(
VBuffer
<float>);
540
/// Naive version of <see cref="VectorUtils.AddMultWithOffset(in
VBuffer
{float}, float, ref
VBuffer
{float}, int)"/>,
543
private static void NaiveAddMult(ref
VBuffer
<float> a, float c, ref
VBuffer
<float> b, int offset)
548
VBuffer
<float> aa = default(
VBuffer
<float>);
574
VBuffer
<float> a = default(
VBuffer
<float>);
575
VBuffer
<float> b = default(
VBuffer
<float>);
576
VBuffer
<float> actualDst = default(
VBuffer
<float>);
577
VBuffer
<float> dst = default(
VBuffer
<float>);
605
VBuffer
<float> a = default(
VBuffer
<float>);
606
VBuffer
<float> b = default(
VBuffer
<float>);
607
VBuffer
<float> actualDst = default(
VBuffer
<float>);
608
VBuffer
<float> dst = default(
VBuffer
<float>);
627
VBuffer
<float> a = default(
VBuffer
<float>);
628
VBuffer
<float> b = default(
VBuffer
<float>);
629
VBuffer
<float> actualDst = default(
VBuffer
<float>);
630
VBuffer
<float> dst = default(
VBuffer
<float>);
652
VBuffer
<float> a = default(
VBuffer
<float>);
653
VBuffer
<float> b = default(
VBuffer
<float>);
654
VBuffer
<float> actualDst = default(
VBuffer
<float>);
655
VBuffer
<float> dst = default(
VBuffer
<float>);
679
VBuffer
<float> a = default(
VBuffer
<float>);
680
VBuffer
<float> b = default(
VBuffer
<float>);
681
VBuffer
<float> actualDst = default(
VBuffer
<float>);
682
VBuffer
<float> dst = default(
VBuffer
<float>);
701
VBuffer
<float> a = default(
VBuffer
<float>);
726
VBuffer
<float> a = default(
VBuffer
<float>);
727
VBuffer
<float> dst = default(
VBuffer
<float>);
752
VBuffer
<float> a = default(
VBuffer
<float>);
753
VBuffer
<float> b = default(
VBuffer
<float>);
782
VBuffer
<float> a = default(
VBuffer
<float>);
783
VBuffer
<float> b = default(
VBuffer
<float>);
821
VBuffer
<float> a = default(
VBuffer
<float>);
822
VBuffer
<float> b = default(
VBuffer
<float>);
847
var
a = default(
VBuffer
<float>);
935
var
expectedVector = new VBuffer<float>(Math.Max(1, expectedLength),
938
var
dst = rgen.Next(2) == 0 ? a : default(
VBuffer
<float>);
966
private static void GenerateSingle(Random rgen, int len, out
VBuffer
<float> a)
972
private static void GenerateVBuffer(Random rgen, int len, int count, out
VBuffer
<float> dst)
1012
private static void FullCopy<T>(ref
VBuffer
<T> src, ref
VBuffer
<T> dst)
1022
private static void TestSame(ref
VBuffer
<float> expected, ref
VBuffer
<float> actual, Double tol = 0)
1027
private static void TestSame<T>(ref
VBuffer
<T> expected, ref
VBuffer
<T> actual, Func<T, T, bool> equalityFunc)
1087
private static void GeneratePair(Random rgen, int len, out
VBuffer
<float> a, out
VBuffer
<float> b, out GenLogic subcase)
1165
private static void TestEquivalent(ref
VBuffer
<float> expected, ref
VBuffer
<float> actual, Double tol = 0)
1170
private static void TestEquivalent<T>(ref
VBuffer
<T> expected, ref
VBuffer
<T> actual, Func<T, T, bool> equalityFunc)
Microsoft.ML.Data (861)
Commands\ShowSchemaCommand.cs (4)
136
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
277
var
value = default(
VBuffer
<T>);
Data\BufferBuilder.cs (2)
393
public void AddFeatures(int index, in
VBuffer
<T> buffer)
435
public void GetResult(ref
VBuffer
<T> buffer)
Data\Conversion.cs (10)
343
private void AddHasNA<T>(InPredicate<
VBuffer
<T>> fn)
353
private void AddHasZero<T>(InPredicate<
VBuffer
<T>> fn)
681
public InPredicate<
VBuffer
<T>> GetHasMissingPredicate<T>(VectorDataViewType type)
697
return (InPredicate<
VBuffer
<T>>)del;
771
private bool HasNA(in
VBuffer
<R4> src) { var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (R4.IsNaN(srcValues[i])) return true; } return false; }
772
private bool HasNA(in
VBuffer
<R8> src) { var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (R8.IsNaN(srcValues[i])) return true; } return false; }
795
private bool HasZero(in
VBuffer
<U1> src) { if (!src.IsDense) return true; var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (srcValues[i] == 0) return true; } return false; }
796
private bool HasZero(in
VBuffer
<U2> src) { if (!src.IsDense) return true; var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (srcValues[i] == 0) return true; } return false; }
797
private bool HasZero(in
VBuffer
<U4> src) { if (!src.IsDense) return true; var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (srcValues[i] == 0) return true; } return false; }
798
private bool HasZero(in
VBuffer
<U8> src) { if (!src.IsDense) return true; var srcValues = src.GetValues(); for (int i = 0; i < srcValues.Length; i++) { if (srcValues[i] == 0) return true; } return false; }
Data\DataViewTypeManager.cs (1)
32
typeof(
VBuffer
<>), typeof(Nullable<>), typeof(DateTime), typeof(DateTimeOffset),
Data\DataViewUtils.cs (5)
963
private sealed class ImplVec<T> : Impl<
VBuffer
<T>>
970
protected override void Getter(ref
VBuffer
<T> value)
1388
var vecGetter = cursor.GetGetter<
VBuffer
<T>>(cursor.Schema[colIndex]);
1389
var
vbuf = default(
VBuffer
<T>);
Data\RowCursorUtils.cs (17)
163
Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<
VBuffer
<int>>> del = GetVecGetterAsCore<int, int>;
172
public static ValueGetter<
VBuffer
<TDst>> GetVecGetterAs<TDst>(PrimitiveDataViewType typeDst, DataViewRow row, int col)
183
Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<
VBuffer
<TDst>>> del = GetVecGetterAsCore<int, TDst>;
185
return (ValueGetter<
VBuffer
<TDst>>)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, GetterFactory.Create(row, col) });
193
internal static ValueGetter<
VBuffer
<TDst>> GetVecGetterAs<TDst>(PrimitiveDataViewType typeDst, SlotCursor cursor)
200
Func<VectorDataViewType, PrimitiveDataViewType, GetterFactory, ValueGetter<
VBuffer
<TDst>>> del = GetVecGetterAsCore<int, TDst>;
202
return (ValueGetter<
VBuffer
<TDst>>)methodInfo.Invoke(null, new object[] { typeSrc, typeDst, GetterFactory.Create(cursor) });
255
private static ValueGetter<
VBuffer
<TDst>> GetVecGetterAsCore<TSrc, TDst>(VectorDataViewType typeSrc, PrimitiveDataViewType typeDst, GetterFactory getterFact)
261
var getter = getterFact.GetGetter<
VBuffer
<TSrc>>();
267
return (ValueGetter<
VBuffer
<TDst>>)(Delegate)getter;
271
var
src = default(
VBuffer
<TSrc>);
272
return (ref
VBuffer
<TDst> dst) =>
414
internal static ValueGetter<
VBuffer
<Single>> GetLabelGetter(SlotCursor cursor)
430
VBuffer
<ulong> src = default(
VBuffer
<ulong>);
432
(ref
VBuffer
<Single> dst) =>
Data\SchemaAnnotationsExtensions.cs (6)
21
/// <seealso cref="GetSlotNames(DataViewSchema.Column, ref
VBuffer
{ReadOnlyMemory{char}})"/>
33
/// <param name="slotNames">The <see cref="
VBuffer
{T}"/> into which the slot names will be stored.</param>
34
public static void GetSlotNames(this DataViewSchema.Column column, ref
VBuffer
<ReadOnlyMemory<char>> slotNames)
47
/// <seealso cref="GetKeyValues{TValue}(DataViewSchema.Column, ref
VBuffer
{TValue})"/>
72
/// <param name="keyValues">The <see cref="
VBuffer
{T}"/> into which the key values will be stored.</param>
73
public static void GetKeyValues<TValue>(this DataViewSchema.Column column, ref
VBuffer
<TValue> keyValues)
Data\SlotCursor.cs (1)
59
public abstract ValueGetter<
VBuffer
<TValue>> GetGetter<TValue>();
DataLoadSave\Binary\BinaryLoader.cs (5)
510
ectx.Assert(valueType.IsGenericEx(typeof(
VBuffer
<>)));
569
private sealed class ImplVec<T> : MetadataTableOfContentsEntry<
VBuffer
<T>>
571
public ImplVec(BinaryLoader parent, string kind, IValueCodec<
VBuffer
<T>> codec,
580
ValueGetter<
VBuffer
<T>> getter = (ref
VBuffer
<T> value) => Value.CopyTo(ref value);
DataLoadSave\Binary\Codecs.cs (8)
764
private sealed class VBufferCodec<T> : IValueCodec<
VBuffer
<T>>
791
Contracts.Assert(type.RawType == typeof(
VBuffer
<T>));
817
public IValueWriter<
VBuffer
<T>> OpenWriter(Stream stream)
822
public IValueReader<
VBuffer
<T>> OpenReader(Stream stream, int items)
827
private sealed class Writer : ValueWriterBase<
VBuffer
<T>>
906
public override void Write(in
VBuffer
<T> value)
938
private sealed class Reader : ValueReaderBase<
VBuffer
<T>>
1084
public override void Get(ref
VBuffer
<T> value)
DataLoadSave\Database\DatabaseLoaderCursor.cs (39)
235
else if (typeof(TValue) == typeof(
VBuffer
<bool>))
239
else if (typeof(TValue) == typeof(
VBuffer
<byte>))
243
else if (typeof(TValue) == typeof(
VBuffer
<DateTime>))
247
else if (typeof(TValue) == typeof(
VBuffer
<double>))
251
else if (typeof(TValue) == typeof(
VBuffer
<short>))
255
else if (typeof(TValue) == typeof(
VBuffer
<int>))
259
else if (typeof(TValue) == typeof(
VBuffer
<long>))
263
else if (typeof(TValue) == typeof(
VBuffer
<sbyte>))
267
else if (typeof(TValue) == typeof(
VBuffer
<float>))
271
else if (typeof(TValue) == typeof(
VBuffer
<ReadOnlyMemory<char>>))
275
else if (typeof(TValue) == typeof(
VBuffer
<ushort>))
279
else if (typeof(TValue) == typeof(
VBuffer
<uint>))
283
else if (typeof(TValue) == typeof(
VBuffer
<ulong>))
373
private ValueGetter<
VBuffer
<bool>> CreateVBufferBooleanGetterDelegate(ColInfo colInfo)
375
return (ref
VBuffer
<bool> value) =>
403
private ValueGetter<
VBuffer
<byte>> CreateVBufferByteGetterDelegate(ColInfo colInfo)
405
return (ref
VBuffer
<byte> value) =>
433
private ValueGetter<
VBuffer
<DateTime>> CreateVBufferDateTimeGetterDelegate(ColInfo colInfo)
435
return (ref
VBuffer
<DateTime> value) =>
463
private ValueGetter<
VBuffer
<double>> CreateVBufferDoubleGetterDelegate(ColInfo colInfo)
465
return (ref
VBuffer
<double> value) =>
493
private ValueGetter<
VBuffer
<short>> CreateVBufferInt16GetterDelegate(ColInfo colInfo)
495
return (ref
VBuffer
<short> value) =>
523
private ValueGetter<
VBuffer
<int>> CreateVBufferInt32GetterDelegate(ColInfo colInfo)
525
return (ref
VBuffer
<int> value) =>
553
private ValueGetter<
VBuffer
<long>> CreateVBufferInt64GetterDelegate(ColInfo colInfo)
555
return (ref
VBuffer
<long> value) =>
583
private ValueGetter<
VBuffer
<sbyte>> CreateVBufferSByteGetterDelegate(ColInfo colInfo)
585
return (ref
VBuffer
<sbyte> value) =>
613
private ValueGetter<
VBuffer
<float>> CreateVBufferSingleGetterDelegate(ColInfo colInfo)
615
return (ref
VBuffer
<float> value) =>
643
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> CreateVBufferStringGetterDelegate(ColInfo colInfo)
645
return (ref
VBuffer
<ReadOnlyMemory<char>> value) =>
673
private ValueGetter<
VBuffer
<ushort>> CreateVBufferUInt16GetterDelegate(ColInfo colInfo)
675
return (ref
VBuffer
<ushort> value) =>
703
private ValueGetter<
VBuffer
<uint>> CreateVBufferUInt32GetterDelegate(ColInfo colInfo)
705
return (ref
VBuffer
<uint> value) =>
733
private ValueGetter<
VBuffer
<ulong>> CreateVBufferUInt64GetterDelegate(ColInfo colInfo)
735
return (ref
VBuffer
<ulong> value) =>
DataLoadSave\FakeSchema.cs (2)
61
ValueGetter<
VBuffer
<TValue>> getter = (ref
VBuffer
<TValue> value) => value = new VBuffer<TValue>(AllVectorSizes, 0, null, null);
DataLoadSave\Text\TextLoader.cs (5)
695
private readonly
VBuffer
<ReadOnlyMemory<char>>[] _slotNames;
895
_slotNames = new
VBuffer
<ReadOnlyMemory<char>>[Infos.Length];
988
_slotNames = new
VBuffer
<ReadOnlyMemory<char>>[Infos.Length];
1050
var
names = _slotNames[i];
1055
metadataBuilder.AddSlotNames(names.Length, (ref
VBuffer
<ReadOnlyMemory<char>> value) => names.CopyTo(ref value));
DataLoadSave\Text\TextLoaderParser.cs (4)
415
public void Get(ref
VBuffer
<TItem> dst)
467
public void Get(ref
VBuffer
<TItem> dst)
477
return (ValueGetter<
VBuffer
<TItem>>)Get;
771
public static void ParseSlotNames(TextLoader parent, ReadOnlyMemory<char> textHeader, ColInfo[] infos,
VBuffer
<ReadOnlyMemory<char>>[] slotNames)
DataLoadSave\Text\TextSaver.cs (4)
156
private readonly ValueGetter<
VBuffer
<T>> _getSrc;
157
private
VBuffer
<T> _src;
158
private readonly
VBuffer
<ReadOnlyMemory<char>> _slotNames;
164
_getSrc = cursor.GetGetter<
VBuffer
<T>>(cursor.Schema[source]);
DataLoadSave\TransformerChain.cs (4)
304
pred = new MulticlassPredictionTransformer<IPredictorProducing<
VBuffer
<float>>>(env,
305
predictor as IPredictorProducing<
VBuffer
<float>>, chain.Schema,
309
pred = new ClusteringPredictionTransformer<IPredictorProducing<
VBuffer
<float>>>(env, predictor as IPredictorProducing<
VBuffer
<float>>, chain.Schema,
DataLoadSave\Transpose\TransposeLoader.cs (10)
673
private readonly ValueGetter<
VBuffer
<T>> _getter;
682
Ch.Assert(cursor.Schema[0].Type.RawType == typeof(
VBuffer
<T>));
686
_getter = _rowCursor.GetGetter<
VBuffer
<T>>(cursor.Schema[0]);
692
public override ValueGetter<
VBuffer
<TValue>> GetGetter<TValue>()
694
ValueGetter<
VBuffer
<TValue>> getter = _getter as ValueGetter<
VBuffer
<TValue>>;
817
ValueGetter<
VBuffer
<T>> getter = cursor.GetGetter<T>();
818
VBuffer
<T> buff = default(
VBuffer
<T>);
838
ValueGetter<
VBuffer
<T>> getter = cursor.GetGetter<T>();
DataView\ArrayDataViewBuilder.cs (18)
23
private readonly Dictionary<string, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>> _getSlotNames;
24
private readonly Dictionary<string, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>> _getKeyValues;
43
_getSlotNames = new Dictionary<string, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>>();
44
_getKeyValues = new Dictionary<string, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>>();
83
public void AddColumn<T1>(string name, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getKeyValues, ulong keyCount, params T1[] values)
97
public void AddColumn<T>(string name, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getNames, PrimitiveDataViewType itemType, params T[][] values)
122
public void AddColumn<T>(string name, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getNames, PrimitiveDataViewType itemType, Combiner<T> combiner, params T[][] values)
147
public void AddColumn<T>(string name, PrimitiveDataViewType itemType, params
VBuffer
<T>[] values)
158
public void AddColumn<T>(string name, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getNames, PrimitiveDataViewType itemType, params
VBuffer
<T>[] values)
451
private abstract class VectorColumn<TIn, TOut> : Column<TIn,
VBuffer
<TOut>>
487
private sealed class VBufferColumn<T> : VectorColumn<
VBuffer
<T>, T>
489
public VBufferColumn(PrimitiveDataViewType itemType,
VBuffer
<T>[] values)
494
protected override void CopyOut(in
VBuffer
<T> src, ref
VBuffer
<T> dst)
507
protected override void CopyOut(in T[] src, ref
VBuffer
<T> dst)
509
VBuffer
<T>.Copy(src, 0, ref dst, Utils.Size(src));
523
protected override void CopyOut(in T[] src, ref
VBuffer
<T> dst)
DataView\CacheDataView.cs (6)
1321
private sealed class ImplVec<T> : ColumnCache<
VBuffer
<T>>
1343
private ValueGetter<
VBuffer
<T>> _getter;
1345
private
VBuffer
<T> _temp;
1355
_getter = input.GetGetter<
VBuffer
<T>>(input.Schema[srcCol]);
1385
public override void Fetch(int idx, ref
VBuffer
<T> value)
1418
_temp = default(
VBuffer
<T>);
DataView\DataViewConstructionUtils.cs (20)
265
Host.Assert(outputType.GetGenericTypeDefinition() == typeof(
VBuffer
<>));
313
return (ValueGetter<
VBuffer
<TDst>>)((ref
VBuffer
<TDst> dst) =>
341
return (ValueGetter<
VBuffer
<TDst>>)((ref
VBuffer
<TDst> dst) =>
354
var peek = peekDel as Peek<TRow,
VBuffer
<TDst>>;
356
VBuffer
<TDst> buf = default;
357
return (ValueGetter<
VBuffer
<TDst>>)((ref
VBuffer
<TDst> dst) =>
918
Contracts.Check(typeof(TDst).IsGenericType && typeof(TDst).GetGenericTypeDefinition() == typeof(
VBuffer
<>));
927
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> method = GetStringArray;
943
Contracts.Assert(typeT.GetGenericTypeDefinition() == typeof(
VBuffer
<>));
944
Contracts.Check(typeof(TDst).GetGenericTypeDefinition() == typeof(
VBuffer
<>));
979
private void GetStringArray(ref
VBuffer
<ReadOnlyMemory<char>> dst)
991
private ValueGetter<
VBuffer
<TDst>> GetArrayGetter<TDst>()
995
return (ref
VBuffer
<TDst> dst) =>
1004
private ValueGetter<
VBuffer
<TDst>> GetVBufferGetter<TDst>()
1006
var
castValue = (
VBuffer
<TDst>)(object)Value;
1007
return (ref
VBuffer
<TDst> dst) => castValue.CopyTo(ref dst);
DataView\InternalSchemaDefinition.cs (1)
169
else if (rawType.IsGenericType && rawType.GetGenericTypeDefinition() == typeof(
VBuffer
<>))
DataView\LambdaColumnMapper.cs (12)
22
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> keyValueGetter = null, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> slotNamesGetter = null)
73
ValueMapper<int, int>, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>,
86
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> keyValueGetter, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> slotNamesGetter)
108
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> keyValueGetter = null, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> slotNamesGetter = null)
125
AnnotationUtils.AnnotationGetter<
VBuffer
<ReadOnlyMemory<char>>> mdGetter =
126
(int c, ref
VBuffer
<ReadOnlyMemory<char>> dst) => keyValueGetter(ref dst);
133
AnnotationUtils.AnnotationGetter<
VBuffer
<ReadOnlyMemory<char>>> mdGetter =
134
(int c, ref
VBuffer
<ReadOnlyMemory<char>> dst) => slotNamesGetter(ref dst);
DataView\Transposer.cs (32)
304
private ValueGetter<
VBuffer
<T>> _getter;
314
public override ValueGetter<
VBuffer
<TValue>> GetGetter<TValue>()
318
ValueGetter<
VBuffer
<TValue>> getter = _getter as ValueGetter<
VBuffer
<TValue>>;
331
protected abstract ValueGetter<
VBuffer
<T>> GetGetterCore();
372
protected override ValueGetter<
VBuffer
<T>> GetGetterCore()
376
VBuffer
<T> cached = default(
VBuffer
<T>);
378
(ref
VBuffer
<T> dst) =>
434
private readonly
VBuffer
<T>[] _rbuff; // Working intermediate row-wise buffer.
443
public
VBuffer
<T> Buffer;
450
public ColumnBufferStorage(
VBuffer
<T> buffer, T[] values, int[] indices)
501
_rbuff = new
VBuffer
<T>[16];
549
var getter = cursor.GetGetter<
VBuffer
<T>>(currentColumn);
569
var
rbuff = _rbuff[r];
608
var
rbuff = _rbuff[r];
622
var
rbuff = _rbuff[pair.Value];
662
var
temp = new VBuffer<T>(_len, count, values, indices);
695
private void Getter(ref
VBuffer
<T> dst)
703
protected override ValueGetter<
VBuffer
<T>> GetGetterCore()
1130
private
VBuffer
<T> _inputValue;
1132
private readonly ValueGetter<
VBuffer
<T>> _inputGetter;
1138
private readonly ValueGetter<
VBuffer
<T>>[] _getters;
1143
_inputGetter = input.GetGetter<
VBuffer
<T>>(input.Schema[Parent.SrcCol]);
1146
_getters = new ValueGetter<
VBuffer
<T>>[Lims.Length];
1179
private ValueGetter<
VBuffer
<T>> CreateGetter(int col)
1184
(ref
VBuffer
<T> value) =>
1340
public static void GetSingleSlotValue<T>(this ITransposeDataView view, int col, ref
VBuffer
<T> dst)
1357
/// type parameter for a <see cref="
VBuffer
{T}"/>, and this is generally preferable and more
1360
/// <see cref="
VBuffer
{T}"/> type.
1362
/// <typeparam name="TValue">The type, must be a <see cref="
VBuffer
{T}"/> generic type,
1372
if (!type.IsGenericEx(typeof(
VBuffer
<>)))
DataView\TypedCursor.cs (11)
385
Ch.Assert(fieldType.GetGenericTypeDefinition() == typeof(
VBuffer
<>));
426
var getter = input.GetGetter<
VBuffer
<TSrc>>(input.Schema[col]);
431
VBuffer
<TSrc> value = default;
448
var getter = input.GetGetter<
VBuffer
<TDst>>(input.Schema[col]);
453
VBuffer
<TDst> value = default(
VBuffer
<TDst>);
515
var getter = input.GetGetter<
VBuffer
<TDst>>(input.Schema[col]);
516
var typedPoke = poke as Poke<TRow,
VBuffer
<TDst>>;
517
var typedPeek = peek as Peek<TRow,
VBuffer
<TDst>>;
520
VBuffer
<TDst> value = default(
VBuffer
<TDst>);
Deprecated\Instances\HeaderSchema.cs (3)
38
(ref
VBuffer
<ReadOnlyMemory<char>> slotNames) => { GetSlotNames(0, ref slotNames); });
44
private void GetSlotNames(int col, ref
VBuffer
<ReadOnlyMemory<char>> dst)
153
public static void Save(ModelSaveContext ctx, in
VBuffer
<ReadOnlyMemory<char>> names)
Deprecated\Vector\VBufferMathUtils.cs (24)
19
public static float NormSquared(in
VBuffer
<float> a)
39
public static float Norm(in
VBuffer
<float> a)
48
public static float L1Norm(in
VBuffer
<float> a)
60
public static float MaxNorm(in
VBuffer
<float> a)
71
public static float Sum(in
VBuffer
<float> a)
84
public static void ScaleBy(ref
VBuffer
<float> dst, float c)
100
public static void ScaleBy(in
VBuffer
<float> src, ref
VBuffer
<float> dst, float c)
139
public static void Add(in
VBuffer
<float> src, ref
VBuffer
<float> dst)
167
public static void AddMult(in
VBuffer
<float> src, float c, ref
VBuffer
<float> dst)
192
public static void AddMult(in
VBuffer
<float> src, float c, ref
VBuffer
<float> dst, ref
VBuffer
<float> res)
222
public static void AddMultInto(in
VBuffer
<float> a, float c, in
VBuffer
<float> b, ref
VBuffer
<float> dst)
240
public static void AddMultWithOffset(in
VBuffer
<float> src, float c, ref
VBuffer
<float> dst, int offset)
381
public static void ScaleInto(in
VBuffer
<float> src, float c, ref
VBuffer
<float> dst)
408
public static int ArgMax(in
VBuffer
<float> src)
444
public static int ArgMin(in
VBuffer
<float> src)
Deprecated\Vector\VectorUtils.cs (21)
15
/// A series of vector utility functions, generally operating over arrays or <see cref="
VBuffer
{T}"/>
30
public static float DotProduct(float[] a, in
VBuffer
<float> b)
41
public static float DotProduct(in
VBuffer
<float> a, in
VBuffer
<float> b)
70
public static void SparsifyNormalize(ref
VBuffer
<float> a, int top, int bottom, bool normalize)
160
public static void MulElementWise(in
VBuffer
<float> a, ref
VBuffer
<float> dst)
251
public static float DotProductWithOffset(in
VBuffer
<float> a, int offset, in
VBuffer
<float> b)
303
public static float DotProductWithOffset(float[] a, int offset, in
VBuffer
<float> b)
369
public static float L1Distance(in
VBuffer
<float> a, in
VBuffer
<float> b)
383
public static float Distance(in
VBuffer
<float> a, in
VBuffer
<float> b)
394
public static float L2DistSquared(in
VBuffer
<float> a, in
VBuffer
<float> b)
414
public static float L2DistSquared(float[] a, in
VBuffer
<float> b)
437
/// Adds a multiple of a <see cref="
VBuffer
{T}"/> to a <see cref="float"/> array.
442
public static void AddMult(in
VBuffer
<float> src, Span<float> dst, float c)
461
/// Adds a multiple of a <see cref="
VBuffer
{T}"/> to a <see cref="float"/> array, with an offset into the destination.
468
public static void AddMultWithOffset(in
VBuffer
<float> src, float[] dst, int offset, float c)
Dirty\PredictorInterfaces.cs (3)
61
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> GetMapper(float[] quantiles);
158
void GetFeatureWeights(ref
VBuffer
<float> weights);
EntryPoints\PredictorModelImpl.cs (1)
130
VBuffer
<ReadOnlyMemory<char>> keyValues = default;
Evaluators\BinaryClassifierEvaluator.cs (4)
175
var
labelNames = default(
VBuffer
<ReadOnlyMemory<char>>);
361
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames =
362
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Evaluators\ClusteringEvaluator.cs (23)
238
private readonly
VBuffer
<Single>[] _clusterCentroids;
297
var
centroidI = _clusterCentroids[i];
305
var
centroidJ = _clusterCentroids[j];
330
_clusterCentroids = new
VBuffer
<Single>[_numClusters];
359
public void InitializeSecondPass(
VBuffer
<Single>[] clusterCentroids)
368
public void UpdateSecondPass(in
VBuffer
<Single> features, int[] indices)
379
private ValueGetter<
VBuffer
<Single>> _scoreGetter;
381
private ValueGetter<
VBuffer
<Single>> _featGetter;
384
private
VBuffer
<Single> _scores;
387
private
VBuffer
<Single> _features;
390
private readonly
VBuffer
<Single>[] _clusterCentroids;
411
_clusterCentroids = new
VBuffer
<Single>[scoreVectorSize];
497
_featGetter = row.GetGetter<
VBuffer
<Single>>(schema.Feature.Value);
501
_scoreGetter = row.GetGetter<
VBuffer
<Single>>(score);
659
VBuffer
<Single> scores = default(
VBuffer
<Single>);
663
var scoreGetter = input.GetGetter<
VBuffer
<Single>>(input.Schema[ScoreIndex]);
691
ValueGetter<
VBuffer
<Single>> topKScoresFn =
692
(ref
VBuffer
<Single> dst) =>
705
ValueGetter<
VBuffer
<uint>> topKClassesFn =
706
(ref
VBuffer
<uint> dst) =>
739
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> CreateSlotNamesGetter(int numTopClusters, string suffix)
742
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Evaluators\EvaluatorBase.cs (2)
206
private protected ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> GetKeyValueGetter(AggregatorDictionaryBase[] dictionaries)
211
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Evaluators\EvaluatorUtils.cs (58)
297
var vBufferGetters = getVectorMetrics ? new ValueGetter<
VBuffer
<double>>[colCount] : null;
313
vBufferGetters[i] = cursor.GetGetter<
VBuffer
<double>>(column);
317
VBuffer
<double> metricVals = default(
VBuffer
<double>);
351
VBuffer
<ReadOnlyMemory<char>> names = default;
410
DataViewType typeSrc, int keyCount, int value, string registrationName, ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> keyValueGetter)
449
inputColType, numFolds, curFold + 1, "FoldIndex", default(ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>));
468
var
slotNamesCur = default(
VBuffer
<ReadOnlyMemory<char>>);
494
var
reconciledSlotNames = new VBuffer<ReadOnlyMemory<char>>(slotNames.Count, slotNames.Keys.Select(k => k.AsMemory()).ToArray());
495
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> slotNamesGetter =
496
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
506
ValueMapper<
VBuffer
<T>,
VBuffer
<T>> mapper;
510
(in
VBuffer
<T> src, ref
VBuffer
<T> dst) =>
534
(in
VBuffer
<T> src, ref
VBuffer
<T> dst) =>
561
var
keyNamesCur = default(
VBuffer
<T>);
615
var
keyNamesVBuffer = new VBuffer<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray());
616
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> keyValueGetter =
617
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
683
var
keyNamesVBuffer = new VBuffer<ReadOnlyMemory<char>>(keyNames.Count, keyNames.Keys.ToArray());
684
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> keyValueGetter =
685
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
691
ValueMapper<
VBuffer
<uint>,
VBuffer
<uint>> mapper =
692
(in
VBuffer
<uint> src, ref
VBuffer
<uint> dst) =>
724
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> slotNamesGetter = null;
731
(ref
VBuffer
<ReadOnlyMemory<char>> dst) => schema[index].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref dst);
814
var firstDvSlotNames = new Dictionary<string,
VBuffer
<ReadOnlyMemory<char>>>();
845
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
854
VBuffer
<ReadOnlyMemory<char>> slotNames;
955
VectorDataViewType type, in
VBuffer
<ReadOnlyMemory<char>> firstDvSlotNames)
964
VBuffer
<ReadOnlyMemory<char>> currSlotNames = default;
988
(in
VBuffer
<TSrc> src, ref
VBuffer
<TSrc> dst) => src.CopyTo(ref dst));
992
ValueGetter<double>[] getters, ValueGetter<
VBuffer
<double>>[] vBufferGetters)
1001
VBuffer
<ReadOnlyMemory<char>> names = default;
1025
vBufferGetters[i] = row.GetGetter<
VBuffer
<double>>(schema[i]);
1099
var vBufferGetters = new ValueGetter<
VBuffer
<double>>[colCount];
1133
VBuffer
<Double> metricVals = default(
VBuffer
<Double>);
1175
private static void UpdateSums(int isWeightedCol, int stratCol, int stratVal, AggregatedMetric[] aggregated, bool hasStdev, List<string> metricNames, bool hasWeighted, bool hasStrats, int colCount, ValueGetter<double>[] getters, ValueGetter<
VBuffer
<double>>[] vBufferGetters, ref double metricVal, ref
VBuffer
<double> metricVals)
1244
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getKeyValues =
1245
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
1312
var
slotNames = new VBuffer<ReadOnlyMemory<char>>(type.Size, names);
1313
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames = (ref
VBuffer
<ReadOnlyMemory<char>> dst) => dst = slotNames;
1397
var
labelNames = default(
VBuffer
<ReadOnlyMemory<char>>);
1448
private static List<ReadOnlyMemory<char>> GetPredictedLabelNames(in
VBuffer
<ReadOnlyMemory<char>> labelNames, int[] labelIndexToConfIndexMap)
1480
var countGetter = cursor.GetGetter<
VBuffer
<double>>(cursor.Schema[countIndex]);
1488
var
count = default(
VBuffer
<double>);
Evaluators\Metrics\MulticlassClassificationMetrics.cs (3)
128
TopKAccuracyForAllK = RowCursorUtils.Fetch<
VBuffer
<double>>(host, overallResult, MulticlassClassificationEvaluator.AllTopKAccuracy).DenseValues().ToImmutableArray();
130
var
perClassLogLoss = RowCursorUtils.Fetch<
VBuffer
<double>>(host, overallResult, MulticlassClassificationEvaluator.PerClassLogLoss);
Evaluators\Metrics\RankingMetrics.cs (2)
61
VBuffer
<double> Fetch(string name) => Fetch<
VBuffer
<double>>(ectx, overallResult, name);
Evaluators\MulticlassClassificationEvaluator.cs (23)
102
var
labelNames = default(
VBuffer
<ReadOnlyMemory<char>>);
224
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getKSlotNames =
225
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
238
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames =
239
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
380
private ValueGetter<
VBuffer
<float>> _scoreGetter;
383
private
VBuffer
<float> _scores;
420
_scoreGetter = row.GetGetter<
VBuffer
<float>>(score);
533
public void GetSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> slotNames)
624
var
classNames = default(
VBuffer
<ReadOnlyMemory<char>>);
719
VBuffer
<float> scores = default(
VBuffer
<float>);
726
var scoreGetter = input.GetGetter<
VBuffer
<float>>(input.Schema[ScoreIndex]);
755
ValueGetter<
VBuffer
<float>> topKScoresFn =
756
(ref
VBuffer
<float> dst) =>
769
ValueGetter<
VBuffer
<uint>> topKClassesFn =
770
(ref
VBuffer
<uint> dst) =>
831
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> CreateSlotNamesGetter(int numTopClasses, string suffix)
834
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
843
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> CreateKeyValueGetter()
846
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Evaluators\MultiOutputRegressionEvaluator.cs (25)
273
private ValueGetter<
VBuffer
<float>> _labelGetter;
274
private ValueGetter<
VBuffer
<float>> _scoreGetter;
279
private
VBuffer
<float> _label;
280
private
VBuffer
<float> _score;
310
_scoreGetter = row.GetGetter<
VBuffer
<float>>(score);
363
public void GetSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> slotNames)
468
var
label = default(
VBuffer
<float>);
469
var
score = default(
VBuffer
<float>);
471
ValueGetter<
VBuffer
<float>> nullGetter = (ref
VBuffer
<float> vec) => vec = default(
VBuffer
<float>);
476
? input.GetGetter<
VBuffer
<float>>(input.Schema[ScoreIndex])
492
ValueGetter<
VBuffer
<float>> labelFn =
493
(ref
VBuffer
<float> dst) =>
502
ValueGetter<
VBuffer
<float>> scoreFn =
503
(ref
VBuffer
<float> dst) =>
593
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> CreateSlotNamesGetter(DataViewSchema schema, int column, int length, string prefix)
599
(ref
VBuffer
<ReadOnlyMemory<char>> dst) => schema[column].Annotations.GetValue(AnnotationUtils.Kinds.SlotNames, ref dst);
602
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
677
var vBufferGetters = new ValueGetter<
VBuffer
<double>>[colCount];
710
vBufferGetters[i] = cursor.GetGetter<
VBuffer
<double>>(currentColumn);
728
VBuffer
<Double> metricVals = default(
VBuffer
<Double>);
Evaluators\QuantileRegressionEvaluator.cs (39)
29
RegressionEvaluatorBase<QuantileRegressionEvaluator.Aggregator,
VBuffer
<float>,
VBuffer
<Double>>
49
var
quantiles = default(
VBuffer
<ReadOnlyMemory<char>>);
73
var
slotNames = default(
VBuffer
<ReadOnlyMemory<char>>);
95
public override
VBuffer
<Double> Rms
109
public override
VBuffer
<Double> RSquared
132
protected override void UpdateCore(float label, in
VBuffer
<float> score, in
VBuffer
<Double> loss, float weight)
138
private void AddL1AndL2Loss(float label, in
VBuffer
<float> score, float weight)
170
private void AddCustomLoss(float weight, in
VBuffer
<Double> loss)
191
protected override void Normalize(in
VBuffer
<Double> src, ref
VBuffer
<Double> dst)
204
protected override
VBuffer
<Double> Zero()
213
private readonly
VBuffer
<ReadOnlyMemory<char>> _slotNames;
220
in
VBuffer
<ReadOnlyMemory<char>> slotNames, string stratName)
233
protected override void ApplyLossFunction(in
VBuffer
<float> score, float label, ref
VBuffer
<Double> loss)
240
protected override bool IsNaN(in
VBuffer
<float> score)
245
public override void AddColumn(ArrayDataViewBuilder dvBldr, string metricName, params
VBuffer
<Double>[] metric)
250
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames =
251
(ref
VBuffer
<ReadOnlyMemory<char>> dst) => dst = _slotNames;
281
private readonly
VBuffer
<ReadOnlyMemory<char>> _quantiles;
284
public QuantileRegressionPerInstanceEvaluator(IHostEnvironment env, DataViewSchema schema, string scoreCol, string labelCol, int scoreSize,
VBuffer
<ReadOnlyMemory<char>> quantiles)
367
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> CreateSlotNamesGetter(string prefix)
370
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
389
var
score = default(
VBuffer
<float>);
390
var
l1 = VBufferUtils.CreateDense<Double>(_scoreSize);
394
ValueGetter<
VBuffer
<float>> scoreGetter;
396
scoreGetter = input.GetGetter<
VBuffer
<float>>(input.Schema[ScoreIndex]);
398
scoreGetter = (ref
VBuffer
<float> dst) => dst = default(
VBuffer
<float>);
417
ValueGetter<
VBuffer
<Double>> l1Fn =
418
(ref
VBuffer
<Double> dst) =>
430
ValueGetter<
VBuffer
<Double>> l2Fn =
431
(ref
VBuffer
<Double> dst) =>
522
(in
VBuffer
<Double> src, ref Double dst) => dst = src.GetItemOrDefault(index));
Evaluators\RankingEvaluator.cs (12)
530
public ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> GetGroupSummarySlotNames(string prefix)
533
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
542
public void GetSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> slotNames)
635
private readonly AnnotationUtils.AnnotationGetter<
VBuffer
<ReadOnlyMemory<char>>> _slotNamesGetter;
680
private void SlotNamesGetter(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
758
ValueGetter<
VBuffer
<Double>> fn =
759
(ref
VBuffer
<Double> dst) => Copy(ndcg, ref dst);
765
ValueGetter<
VBuffer
<Double>> fn = (ref
VBuffer
<Double> dst) => Copy(dcg, ref dst);
771
ValueGetter<
VBuffer
<Double>> fn = (ref
VBuffer
<Double> dst) => Copy(maxDcg, ref dst);
777
private void Copy(Double[] src, ref
VBuffer
<Double> dst)
Prediction\Calibrator.cs (4)
338
ValueMapper<TSrc,
VBuffer
<float>> IFeatureContributionMapper.GetFeatureContributionMapper<TSrc, TDst>(int top, int bottom, bool normalize)
535
public void GetFeatureWeights(ref
VBuffer
<float> weights)
612
public void GetFeatureWeights(ref
VBuffer
<float> weights)
807
ValueMapper<TSrc,
VBuffer
<float>> IFeatureContributionMapper.GetFeatureContributionMapper<TSrc, TDst>(int top, int bottom, bool normalize)
Prediction\ICalculateFeatureContribution.cs (1)
24
ValueMapper<TSrc,
VBuffer
<float>> GetFeatureContributionMapper<TSrc, TDst>(int top, int bottom, bool normalize);
Scorers\BinaryClassifierScorer.cs (2)
119
ValueGetter<
VBuffer
<T>> getter = (ref
VBuffer
<T> value) =>
Scorers\ClusteringScorer.cs (6)
99
ValueGetter<
VBuffer
<float>> mapperScoreGetter = output.GetGetter<
VBuffer
<float>>(output.Schema[Bindings.ScoreColumnIndex]);
102
VBuffer
<float> score = default(
VBuffer
<float>);
117
ValueGetter<
VBuffer
<float>> scoreFn =
118
(ref
VBuffer
<float> dst) =>
Scorers\FeatureContributionCalculation.cs (12)
191
public Delegate GetTextContributionGetter(DataViewRow input, int colSrc,
VBuffer
<ReadOnlyMemory<char>> slotNames)
197
Func<DataViewRow, int,
VBuffer
<ReadOnlyMemory<char>>, ValueGetter<ReadOnlyMemory<char>>> del = GetTextValueGetter<int>;
214
private ReadOnlyMemory<char> GetSlotName(int index,
VBuffer
<ReadOnlyMemory<char>> slotNames)
223
private ValueGetter<ReadOnlyMemory<char>> GetTextValueGetter<TSrc>(DataViewRow input, int colSrc,
VBuffer
<ReadOnlyMemory<char>> slotNames)
229
var map = Predictor.GetFeatureContributionMapper<TSrc,
VBuffer
<float>>(_topContributionsCount, _bottomContributionsCount, _normalize);
232
var
contributions = default(
VBuffer
<float>);
262
private ValueGetter<
VBuffer
<float>> GetValueGetter<TSrc>(DataViewRow input, int colSrc)
271
var map = Predictor.GetFeatureContributionMapper<TSrc,
VBuffer
<float>>(_topContributionsCount, _bottomContributionsCount, _normalize);
274
(ref
VBuffer
<float> dst) =>
302
private readonly
VBuffer
<ReadOnlyMemory<char>> _slotNames;
340
metadataBuilder.AddSlotNames(featureSize, (ref
VBuffer
<ReadOnlyMemory<char>> value) =>
Scorers\MulticlassClassificationScorer.cs (22)
152
_host.CheckDecode(value is
VBuffer
<T>);
153
VBuffer
<T> buffValue = (
VBuffer
<T>)value;
154
ValueGetter<
VBuffer
<T>> buffGetter = (ref
VBuffer
<T> dst) => buffValue.CopyTo(ref dst);
194
Contracts.Assert(_getter is ValueGetter<
VBuffer
<T>>);
196
var getter = (ValueGetter<
VBuffer
<T>>)_getter;
197
var
val = default(
VBuffer
<T>);
202
if (!saver.TryWriteTypeAndValue<
VBuffer
<T>>(ctx.Writer.BaseStream, _type, ref val, out bytesWritten))
245
env.Assert(getter is ValueGetter<
VBuffer
<T>>);
249
return new Bound<T>(env, mapper, type, (ValueGetter<
VBuffer
<T>>)getter, metadataKind, canWrap);
259
private readonly ValueGetter<
VBuffer
<T>> _labelNameGetter;
282
public Bound(IHostEnvironment env, ISchemaBoundRowMapper mapper, VectorDataViewType type, ValueGetter<
VBuffer
<T>> getter,
312
ValueGetter<
VBuffer
<T>> labelNameGetter, string labelNameKind)
498
ValueGetter<
VBuffer
<T>> getter =
499
(ref
VBuffer
<T> value) =>
568
ValueGetter<
VBuffer
<float>> mapperScoreGetter = output.GetGetter<
VBuffer
<float>>(Bindings.RowMapper.OutputSchema[Bindings.ScoreColumnIndex]);
571
VBuffer
<float> score = default;
585
ValueGetter<
VBuffer
<float>> scoreFn =
586
(ref
VBuffer
<float> dst) =>
Scorers\PredictionTransformer.cs (7)
29
[assembly: LoadableClass(typeof(ClusteringPredictionTransformer<IPredictorProducing<
VBuffer
<float>>>), typeof(ClusteringPredictionTransformer), null, typeof(SignatureLoadModel),
739
var host = Contracts.CheckRef(env, nameof(env)).Register(nameof(MulticlassPredictionTransformer<IPredictorProducing<
VBuffer
<float>>>));
740
ctx.LoadModel<IPredictorProducing<
VBuffer
<float>>, SignatureLoadModel>(host, out IPredictorProducing<
VBuffer
<float>> model, DirModel);
796
internal static object Create(IHostEnvironment env, ModelLoadContext ctx, IHost host, IPredictorProducing<
VBuffer
<float>> model, Type predictionTransformerType)
869
public static ClusteringPredictionTransformer<IPredictorProducing<
VBuffer
<float>>> Create(IHostEnvironment env, ModelLoadContext ctx)
870
=> new ClusteringPredictionTransformer<IPredictorProducing<
VBuffer
<float>>>(env, ctx);
Scorers\SchemaBindablePredictorWrapper.cs (13)
562
var featureGetter = InputRoleMappedSchema.Feature.HasValue ? input.GetGetter<
VBuffer
<float>>(InputRoleMappedSchema.Feature.Value) : null;
566
var
features = default(
VBuffer
<float>);
567
ValueMapper<
VBuffer
<float>, float, float> mapper;
569
mapper = _parent._distMapper.GetMapper<
VBuffer
<float>, float, float>();
594
private static void EnsureCachedResultValueMapper(ValueMapper<
VBuffer
<float>, float, float> mapper,
595
ref long cachedPosition, ValueGetter<
VBuffer
<float>> featureGetter, ref
VBuffer
<float> features,
710
var featureGetter = input.GetGetter<
VBuffer
<float>>(column);
718
var
features = default(
VBuffer
<float>);
719
ValueGetter<
VBuffer
<float>> del =
720
(ref
VBuffer
<float> value) =>
Scorers\ScoreSchemaFactory.cs (3)
91
metadataBuilder.AddSlotNames(quantiles.Length, (ref
VBuffer
<ReadOnlyMemory<char>> value) =>
117
public static DataViewSchema CreateSequencePredictionSchema(DataViewType scoreType, string scoreColumnKindValue,
VBuffer
<ReadOnlyMemory<char>> keyNames = default)
126
(ref
VBuffer
<ReadOnlyMemory<char>> value) => value = keyNames);
Training\TrainerUtils.cs (6)
262
public static ValueGetter<
VBuffer
<float>> GetFeatureFloatVectorGetter(this DataViewRow row, RoleMappedSchema schema)
269
return row.GetGetter<
VBuffer
<float>>(schema.Feature.Value);
275
public static ValueGetter<
VBuffer
<float>> GetFeatureFloatVectorGetter(this DataViewRow row, RoleMappedData data)
813
/// as a <see cref="
VBuffer
{Float}"/>.
818
private readonly ValueGetter<
VBuffer
<float>> _get;
823
public
VBuffer
<float> Features;
Transforms\ColumnConcatenatingTransformer.cs (12)
585
metadata.Add(AnnotationUtils.Kinds.CategoricalSlotRanges, _categoricalRangeType, (ValueGetter<
VBuffer
<int>>)GetCategoricalSlotRanges);
592
private void GetCategoricalSlotRanges(ref
VBuffer
<int> dst)
618
private void GetSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> dst)
630
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
692
var srcGetterVecs = new ValueGetter<
VBuffer
<T>>[SrcIndices.Length];
699
srcGetterVecs[j] = input.GetGetter<
VBuffer
<T>>(column);
705
VBuffer
<T>[] tmpBufs = new
VBuffer
<T>[SrcIndices.Length];
706
ValueGetter<
VBuffer
<T>> result = (ref
VBuffer
<T> dst) =>
744
var
buffer = tmpBufs[j];
Transforms\FeatureContributionCalculationTransformer.cs (4)
171
private readonly
VBuffer
<ReadOnlyMemory<char>> _slotNames;
220
var map = _parent._predictor.GetFeatureContributionMapper<TSrc,
VBuffer
<float>>(_parent.Top, _parent.Bottom, _parent.Normalize);
223
return (ValueGetter<
VBuffer
<float>>)((ref
VBuffer
<float> dst) =>
Transforms\Hashing.cs (55)
144
private readonly
VBuffer
<ReadOnlyMemory<char>>[] _keyValues;
248
_keyValues = new
VBuffer
<ReadOnlyMemory<char>>[_columns.Length];
402
private ValueGetter<
VBuffer
<uint>> ComposeGetterVec(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType)
449
private ValueGetter<
VBuffer
<uint>> ComposeGetterVecCore<T, THash>(DataViewRow input, int iinfo, int srcCol, VectorDataViewType srcType)
454
var getSrc = input.GetGetter<
VBuffer
<T>>(input.Schema[srcCol]);
538
uint HashCore(uint seed, uint mask, in
VBuffer
<T> values);
552
public uint HashCore(uint seed, uint mask, in
VBuffer
<float> values)
586
public uint HashCore(uint seed, uint mask, in
VBuffer
<double> values)
621
public uint HashCore(uint seed, uint mask, in
VBuffer
<ReadOnlyMemory<char>> values)
645
public uint HashCore(uint seed, uint mask, in
VBuffer
<byte> values)
669
public uint HashCore(uint seed, uint mask, in
VBuffer
<ushort> values)
693
public uint HashCore(uint seed, uint mask, in
VBuffer
<uint> values)
725
public uint HashCore(uint seed, uint mask, in
VBuffer
<ulong> values)
759
public uint HashCore(uint seed, uint mask, in
VBuffer
<byte> values)
779
public uint HashCore(uint seed, uint mask, in
VBuffer
<ushort> values)
799
public uint HashCore(uint seed, uint mask, in
VBuffer
<uint> values)
823
public uint HashCore(uint seed, uint mask, in
VBuffer
<ulong> values)
857
public uint HashCore(uint seed, uint mask, in
VBuffer
<DataViewRowId> values)
894
public uint HashCore(uint seed, uint mask, in
VBuffer
<bool> values)
914
public uint HashCore(uint seed, uint mask, in
VBuffer
<sbyte> values)
934
public uint HashCore(uint seed, uint mask, in
VBuffer
<short> values)
954
public uint HashCore(uint seed, uint mask, in
VBuffer
<int> values)
978
public uint HashCore(uint seed, uint mask, in
VBuffer
<long> values)
1023
private static ValueGetter<
VBuffer
<uint>> MakeVectorHashGetter<T, THash>(uint seed, uint mask, ValueGetter<
VBuffer
<T>> srcGetter, bool useOldHashing)
1028
VBuffer
<T> src = default;
1039
return (ref
VBuffer
<uint> dst) =>
1059
return (ref
VBuffer
<uint> dst) =>
1093
return (ref
VBuffer
<uint> dst) =>
1113
return (ref
VBuffer
<uint> dst) =>
1141
private static ValueGetter<
VBuffer
<uint>> MakeVectorOrderedHashGetter<T, THash>(uint seed, uint mask, ValueGetter<
VBuffer
<T>> srcGetter, bool useOldHashing)
1146
VBuffer
<T> src = default;
1157
return (ref
VBuffer
<uint> dst) =>
1185
return (ref
VBuffer
<uint> dst) =>
1221
return (ref
VBuffer
<uint> dst) =>
1249
return (ref
VBuffer
<uint> dst) =>
1285
var getSrc = input.GetGetter<
VBuffer
<T>>(input.Schema[srcCol]);
1286
VBuffer
<T> src = default;
1347
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
1530
public abstract
VBuffer
<ReadOnlyMemory<char>> GetKeyValuesMetadata();
1615
public override
VBuffer
<ReadOnlyMemory<char>> GetKeyValuesMetadata()
1657
private readonly ValueGetter<
VBuffer
<T>> _srcGetter;
1658
private readonly ValueGetter<
VBuffer
<uint>> _dstGetter;
1660
private
VBuffer
<T> _value;
1661
private
VBuffer
<uint> _hash;
1666
_srcGetter = Row.GetGetter<
VBuffer
<T>>(Row.Schema[_srcCol]);
1667
_dstGetter = dstGetter as ValueGetter<
VBuffer
<uint>>;
1691
private readonly ValueGetter<
VBuffer
<T>> _srcGetter;
1692
private readonly ValueGetter<
VBuffer
<uint>> _dstGetter;
1694
private
VBuffer
<T> _value;
1695
private
VBuffer
<uint> _hash;
1700
_srcGetter = Row.GetGetter<
VBuffer
<T>>(Row.Schema[_srcCol]);
1701
_dstGetter = dstGetter as ValueGetter<
VBuffer
<uint>>;
Transforms\InvertHashUtils.cs (14)
53
VBuffer
<ReadOnlyMemory<char>> keyValues = default;
229
public
VBuffer
<ReadOnlyMemory<char>> GetMetadata()
320
/// Simple utility class for saving a <see cref="
VBuffer
{T}"/> of ReadOnlyMemory
339
private static void Load(IChannel ch, ModelLoadContext ctx, CodecFactory factory, ref
VBuffer
<ReadOnlyMemory<char>> values)
363
var textCodec = (IValueCodec<
VBuffer
<ReadOnlyMemory<char>>>)codec;
372
values = default(
VBuffer
<ReadOnlyMemory<char>>);
379
private static void Save(IChannel ch, ModelSaveContext ctx, CodecFactory factory, in
VBuffer
<ReadOnlyMemory<char>> values)
398
IValueCodec<
VBuffer
<ReadOnlyMemory<char>>> textCodec = (IValueCodec<
VBuffer
<ReadOnlyMemory<char>>>)codec;
414
var
v = values;
444
public static void LoadAll(IHost host, ModelLoadContext ctx, int infoLim, out
VBuffer
<ReadOnlyMemory<char>>[] keyValues, out VectorDataViewType[] kvTypes)
452
VBuffer
<ReadOnlyMemory<char>>[] keyValuesLocal = null;
464
keyValuesLocal = new
VBuffer
<ReadOnlyMemory<char>>[infoLim];
478
public static void SaveAll(IHost host, ModelSaveContext ctx, int infoLim,
VBuffer
<ReadOnlyMemory<char>>[] keyValues)
Transforms\KeyToValue.cs (10)
258
var
keyMetadata = default(
VBuffer
<TValue>);
308
private readonly
VBuffer
<TValue> _values;
316
public KeyToValueMap(Mapper parent, KeyDataViewType typeKey, PrimitiveDataViewType typeVal,
VBuffer
<TValue> values, int iinfo)
381
var
src = default(
VBuffer
<TKey>);
383
ValueGetter<
VBuffer
<TKey>> getSrc = input.GetGetter<
VBuffer
<TKey>>(column);
384
ValueGetter<
VBuffer
<TValue>> retVal =
385
(ref
VBuffer
<TValue> dst) =>
Transforms\KeyToVector.cs (21)
326
var getter = inputMetadata.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(keyValuesColumn.Value);
335
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
346
ValueGetter<
VBuffer
<int>> getter = (ref
VBuffer
<int> dst) =>
364
private void GetSlotNames(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
375
var
namesSlotSrc = default(
VBuffer
<ReadOnlyMemory<char>>);
393
var
namesKeySrc = default(
VBuffer
<ReadOnlyMemory<char>>);
426
private void GetCategoricalSlotRanges(int iinfo, ref
VBuffer
<int> dst)
467
private ValueGetter<
VBuffer
<float>> MakeGetterOne(DataViewRow input, int iinfo)
480
(ref
VBuffer
<float> dst) =>
500
private ValueGetter<
VBuffer
<float>> MakeGetterBag(DataViewRow input, int iinfo)
519
var
src = default(
VBuffer
<uint>);
522
(ref
VBuffer
<float> dst) =>
546
private ValueGetter<
VBuffer
<float>> MakeGetterInd(DataViewRow input, int iinfo)
565
var
src = default(
VBuffer
<uint>);
567
(ref
VBuffer
<float> dst) =>
Transforms\LabelConvertTransform.cs (3)
223
public override ValueGetter<
VBuffer
<TValue>> GetGetter<TValue>()
225
ValueGetter<
VBuffer
<TValue>> getter = _getter as ValueGetter<
VBuffer
<TValue>>;
Transforms\NAFilter.cs (7)
309
Contracts.Assert(info.Type.RawType == typeof(
VBuffer
<T>));
311
var getSrc = cursor.Input.GetGetter<
VBuffer
<T>>(cursor.Input.Schema[info.Index]);
360
private sealed class ValueVec<T> : TypedValue<
VBuffer
<T>>
362
private readonly ValueGetter<
VBuffer
<T>> _getter;
364
public ValueVec(Cursor cursor, ValueGetter<
VBuffer
<T>> getSrc, InPredicate<
VBuffer
<T>> hasBad)
370
public void GetValue(ref
VBuffer
<T> dst)
Transforms\NormalizeColumn.cs (31)
500
bldr.AddGetter<
VBuffer
<TFloat>>("AffineScale", typeSrc, ScaleMetadataGetter);
502
bldr.AddGetter<
VBuffer
<TFloat>>("AffineOffset", typeSrc, OffsetMetadataGetter);
505
private void ScaleMetadataGetter(int col, ref
VBuffer
<TFloat> dst)
507
var
src = new VBuffer<TFloat>(Scale.Length, Scale);
511
private void OffsetMetadataGetter(int col, ref
VBuffer
<TFloat> dst)
514
var
src = new VBuffer<TFloat>(Offset.Length, Offset);
620
bldr.AddGetter<
VBuffer
<TFloat>>("CdfMean", typeSrc, MeanMetadataGetter);
621
bldr.AddGetter<
VBuffer
<TFloat>>("CdfStdDev", typeSrc, StddevMetadataGetter);
625
private void MeanMetadataGetter(int col, ref
VBuffer
<TFloat> dst)
627
var
src = new VBuffer<TFloat>(Mean.Length, Mean);
631
private void StddevMetadataGetter(int col, ref
VBuffer
<TFloat> dst)
633
var
src = new VBuffer<TFloat>(Stddev.Length, Stddev);
759
private readonly ValueGetter<
VBuffer
<TFloat>> _getSrc;
760
private
VBuffer
<TFloat> _buffer;
762
protected VecColumnFunctionBuilderBase(IHost host, long lim, ValueGetter<
VBuffer
<TFloat>> getSrc)
777
protected virtual bool ProcessValue(in
VBuffer
<TFloat> buffer)
905
private readonly ValueGetter<
VBuffer
<TFloat>> _colValueGetter;
906
private
VBuffer
<TFloat> _buffer;
915
_colValueGetter = dataRow.GetGetter<
VBuffer
<TFloat>>(valueCol);
924
_buffer = default(
VBuffer
<TFloat>);
961
protected abstract bool AcceptColumnValue(in
VBuffer
<TFloat> buffer);
993
return Sng.MinMaxVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Single>>(srcColumn));
995
return Dbl.MinMaxVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Double>>(srcColumn));
1032
return Sng.MeanVarVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Single>>(srcColumn));
1034
return Dbl.MeanVarVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Double>>(srcColumn));
1073
return Sng.MeanVarVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Single>>(srcColumn));
1075
return Dbl.MeanVarVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Double>>(srcColumn));
1113
return Sng.BinVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Single>>(srcColumn));
1115
return Dbl.BinVecColumnFunctionBuilder.Create(column, host, vectorType, cursor.GetGetter<
VBuffer
<Double>>(srcColumn));
1224
return Sng.RobustScalerVecFunctionBuilder.Create(column, host, srcType as VectorDataViewType, column.CenterData, column.QuantileMin, column.QuantileMax, cursor.GetGetter<
VBuffer
<float>>(srcColumn));
1226
return Dbl.RobustScalerVecFunctionBuilder.Create(column, host, srcType as VectorDataViewType, column.CenterData, column.QuantileMin, column.QuantileMax, cursor.GetGetter<
VBuffer
<double>>(srcColumn));
Transforms\NormalizeColumnDbl.cs (39)
318
internal sealed class MinMaxDblAggregator : IColumnAggregator<
VBuffer
<TFloat>>
353
public void ProcessValue(in
VBuffer
<TFloat> value)
465
public void ProcessValue(in
VBuffer
<TFloat> value)
785
var getSrc = input.GetGetter<
VBuffer
<TFloat>>(input.Schema[icol]);
787
ValueGetter<
VBuffer
<TFloat>> del;
790
del = (ref
VBuffer
<TFloat> dst) =>
800
del = (ref
VBuffer
<TFloat> dst) =>
810
del = (ref
VBuffer
<TFloat> dst) =>
823
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale)
852
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale,
896
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale,
1082
var getSrc = input.GetGetter<
VBuffer
<TFloat>>(input.Schema[icol]);
1084
ValueGetter<
VBuffer
<TFloat>> del;
1085
del = (ref
VBuffer
<TFloat> dst) =>
1096
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] mean,
1296
var getSrc = input.GetGetter<
VBuffer
<TFloat>>(input.Schema[icol]);
1298
ValueGetter<
VBuffer
<TFloat>> del =
1299
(ref
VBuffer
<TFloat> dst) =>
1308
private void GetResult(in
VBuffer
<TFloat> input, ref
VBuffer
<TFloat> value, BufferBuilder<TFloat> bldr)
1524
private
VBuffer
<TFloat> _buffer;
1574
protected MinMaxVecColumnFunctionBuilderBase(IHost host, int cv, long lim, bool fix, ValueGetter<
VBuffer
<TFloat>> getSrc)
1581
protected override bool ProcessValue(in
VBuffer
<TFloat> buffer)
1596
ValueGetter<
VBuffer
<TFloat>> getSrc)
1602
ValueGetter<
VBuffer
<TFloat>> getter)
1652
private
VBuffer
<TFloat> _buffer;
1736
ValueGetter<
VBuffer
<TFloat>> getSrc, bool useLog, bool useCdf, bool useSampleVariance)
1747
ValueGetter<
VBuffer
<TFloat>> getter)
1755
ValueGetter<
VBuffer
<TFloat>> getter)
1763
protected override bool ProcessValue(in
VBuffer
<TFloat> buffer)
1904
ValueGetter<
VBuffer
<TFloat>> getSrc)
1917
ValueGetter<
VBuffer
<TFloat>> getter)
1928
protected override bool ProcessValue(in
VBuffer
<TFloat> buffer)
2026
protected override bool AcceptColumnValue(in
VBuffer
<TFloat> colValuesBuffer)
2059
private
VBuffer
<double> _buffer;
2109
public sealed class RobustScalerVecFunctionBuilder : OneColumnFunctionBuilderBase<
VBuffer
<double>>
2117
private RobustScalerVecFunctionBuilder(IHost host, long lim, int vectorSize, bool centerData, uint quantileMin, uint quantileMax, ValueGetter<
VBuffer
<double>> getSrc)
2137
protected override bool ProcessValue(in
VBuffer
<double> val)
2154
bool centerData, uint quantileMin, uint quantileMax, ValueGetter<
VBuffer
<double>> getter)
Transforms\NormalizeColumnSng.cs (39)
318
internal sealed class MinMaxSngAggregator : IColumnAggregator<
VBuffer
<TFloat>>
353
public void ProcessValue(in
VBuffer
<TFloat> value)
466
public void ProcessValue(in
VBuffer
<TFloat> value)
942
var getSrc = input.GetGetter<
VBuffer
<TFloat>>(input.Schema[icol]);
944
ValueGetter<
VBuffer
<TFloat>> del;
947
del = (ref
VBuffer
<TFloat> dst) =>
957
del = (ref
VBuffer
<TFloat> dst) =>
967
del = (ref
VBuffer
<TFloat> dst) =>
980
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale)
1010
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale,
1055
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] scale,
1242
var getSrc = input.GetGetter<
VBuffer
<TFloat>>(input.Schema[icol]);
1244
ValueGetter<
VBuffer
<TFloat>> del;
1245
del = (ref
VBuffer
<TFloat> dst) =>
1256
private static void FillValues(in
VBuffer
<TFloat> input, BufferBuilder<TFloat> bldr, TFloat[] mean,
1457
var getSrc = input.GetGetter<
VBuffer
<TFloat>>(input.Schema[icol]);
1459
ValueGetter<
VBuffer
<TFloat>> del =
1460
(ref
VBuffer
<TFloat> dst) =>
1469
private void GetResult(in
VBuffer
<TFloat> input, ref
VBuffer
<TFloat> value, BufferBuilder<TFloat> bldr)
1687
private
VBuffer
<TFloat> _buffer;
1737
protected MinMaxVecColumnFunctionBuilderBase(IHost host, int cv, long lim, bool fix, ValueGetter<
VBuffer
<TFloat>> getSrc)
1744
protected override bool ProcessValue(in
VBuffer
<TFloat> buffer)
1759
ValueGetter<
VBuffer
<TFloat>> getSrc)
1765
ValueGetter<
VBuffer
<TFloat>> getter)
1815
private
VBuffer
<TFloat> _buffer;
1899
ValueGetter<
VBuffer
<TFloat>> getSrc, bool useLog, bool useCdf, bool useSampleVariance)
1910
ValueGetter<
VBuffer
<TFloat>> getter)
1918
ValueGetter<
VBuffer
<TFloat>> getter)
1926
protected override bool ProcessValue(in
VBuffer
<TFloat> buffer)
2067
ValueGetter<
VBuffer
<TFloat>> getSrc)
2080
ValueGetter<
VBuffer
<TFloat>> getter)
2091
protected override bool ProcessValue(in
VBuffer
<TFloat> buffer)
2190
protected override bool AcceptColumnValue(in
VBuffer
<TFloat> colValuesBuffer)
2223
private
VBuffer
<TFloat> _buffer;
2273
public sealed class RobustScalerVecFunctionBuilder : OneColumnFunctionBuilderBase<
VBuffer
<TFloat>>
2281
private RobustScalerVecFunctionBuilder(IHost host, long lim, int vectorSize, bool centerData, uint quantileMin, uint quantileMax, ValueGetter<
VBuffer
<TFloat>> getSrc)
2299
protected override bool ProcessValue(in
VBuffer
<TFloat> val)
2316
bool centerData, uint quantileMin, uint quantileMax, ValueGetter<
VBuffer
<TFloat>> getter)
Transforms\RowShufflingTransformer.cs (3)
398
private sealed class ImplVec<T> : ShufflePipe<
VBuffer
<T>>
405
protected override void Copy(in
VBuffer
<T> src, ref
VBuffer
<T> dst)
Transforms\SlotsDroppingTransformer.cs (18)
550
private void GetSlotNames(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
554
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
559
private void GetCategoricalSlotRanges(int iinfo, ref
VBuffer
<int> dst)
568
private void GetCategoricalSlotRangesCore(int iinfo, int[] slotsMin, int[] slotsMax, int[] catRanges, ref
VBuffer
<int> dst)
769
private ValueGetter<
VBuffer
<TDst>> MakeVecTrivialGetter<TDst>()
775
private void VecTrivialGetter<TDst>(ref
VBuffer
<TDst> value)
790
private ValueGetter<
VBuffer
<TDst>> MakeVecGetter<TDst>(DataViewRow input, int iinfo)
792
var srcGetter = GetSrcGetter<
VBuffer
<TDst>>(input, iinfo);
798
var
buffer = default(
VBuffer
<TDst>);
800
(ref
VBuffer
<TDst> value) =>
846
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> slotNamesGetter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) => GetSlotNames(iinfo, ref dst);
856
VBuffer
<int> dst = default(
VBuffer
<int>);
863
ValueGetter<
VBuffer
<int>> categoricalSlotRangesGetter = (ref
VBuffer
<int> dest) => GetCategoricalSlotRanges(iinfo, ref dest);
Transforms\ValueMapping.cs (9)
211
private static ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> GetKeyValueGetter<TKey>(TKey[] keys)
214
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
914
var
src = default(
VBuffer
<TKey>);
915
var getSrc = input.GetGetter<
VBuffer
<TKey>>(column);
917
ValueGetter<
VBuffer
<TValue>> retVal =
918
(ref
VBuffer
<TValue> dst) =>
956
if (value is
VBuffer
<T> valueRef)
958
VBuffer
<T> dest = default;
Transforms\ValueToKeyMappingTransformer.cs (4)
769
var
terms = default(
VBuffer
<T>);
965
var
terms = default(
VBuffer
<ReadOnlyMemory<char>>);
Transforms\ValueToKeyMappingTransformerImpl.cs (36)
324
var inputGetter = row.GetGetter<
VBuffer
<T>>(row.Schema[col]);
372
private readonly ValueGetter<
VBuffer
<T>> _getter;
373
private
VBuffer
<T> _val;
377
public ImplVec(ValueGetter<
VBuffer
<T>> getter, int max, Builder<T> bldr)
654
public override void GetTerms(ref
VBuffer
<ReadOnlyMemory<char>> dst)
733
public override void GetTerms(ref
VBuffer
<T> dst)
772
public abstract void GetTerms(ref
VBuffer
<T> dst);
775
private static void GetTextTerms<T>(in
VBuffer
<T> src, ValueMapper<T, StringBuilder> stringMapper, ref
VBuffer
<ReadOnlyMemory<char>> dst)
934
var getSrc = input.GetGetter<
VBuffer
<T>>(inputColumn);
935
VBuffer
<T> src = default(
VBuffer
<T>);
936
ValueGetter<
VBuffer
<uint>> retVal;
947
(ref
VBuffer
<uint> dst) =>
982
(ref
VBuffer
<uint> dst) =>
1052
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter =
1053
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
1056
VBuffer
<T> dstT = default;
1064
ValueGetter<
VBuffer
<T>> getter =
1065
(ref
VBuffer
<T> dst) =>
1123
ValueGetter<
VBuffer
<TMeta>> getter =
1124
(ref
VBuffer
<TMeta> dst) =>
1126
VBuffer
<TMeta> srcMeta = default(
VBuffer
<TMeta>);
1130
VBuffer
<T> keyVals = default(
VBuffer
<T>);
1149
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> mgetter =
1150
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
1152
var
tempMeta = default(
VBuffer
<TMeta>);
1162
ValueGetter<
VBuffer
<TMeta>> mgetter =
1163
(ref
VBuffer
<TMeta> dst) =>
1203
VBuffer
<TMeta> srcMeta = default(
VBuffer
<TMeta>);
1208
VBuffer
<T> keyVals = default(
VBuffer
<T>);
Utilities\ColumnCursor.cs (4)
142
var getter = cursor.GetGetter<
VBuffer
<T>>(column);
143
VBuffer
<T> curValue = default;
164
var getter = cursor.GetGetter<
VBuffer
<TData>>(column);
165
VBuffer
<TData> curValue = default;
Utilities\SlotDropper.cs (5)
88
public ValueGetter<
VBuffer
<T>> SubsetGetter<T>(ValueGetter<
VBuffer
<T>> getter)
91
(ref
VBuffer
<T> src) =>
102
public void DropSlots<TDst>(ref
VBuffer
<TDst> src, ref
VBuffer
<TDst> dst)
Utils\ApiUtils.cs (1)
39
(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(
VBuffer
<>)) ||
Microsoft.ML.DataView (39)
DataViewType.cs (1)
60
/// which through the buffer sharing mechanisms of its <see cref="
VBuffer
{T}"/> representation type,
VBuffer.cs (17)
21
/// a mutable variant <see cref="VBufferEditor{T}"/> can be accessed through <see cref="
VBuffer
{T}"/>.
23
/// Throughout the code, we make the assumption that a sparse <see cref="
VBuffer
{T}"/> is logically equivalent to
24
/// a dense <see cref="
VBuffer
{T}"/> with the default value for <typeparamref name="T"/> filling in the default values.
27
/// this code and practically all code that uses <see cref="
VBuffer
{T}"/> makes the assumption that an assignment of
76
/// this <see cref="
VBuffer
{T}"/> stands for a vector with non-zero values 98 and 76 respectively at the 4th and 6th
108
/// <see cref="
VBuffer
{T}"/>, but you happen to have an indices array "left over" and you don't want to
174
/// <param name="destination">The destination buffer. After the copy, this will have <see cref="
VBuffer
{T}.Length"/>
176
public void CopyToDense(ref
VBuffer
<T> destination)
191
/// <param name="destination">The destination buffer. After the copy, this will have <see cref="
VBuffer
{T}.Length"/>
193
public void CopyTo(ref
VBuffer
<T> destination)
219
/// <param name="destination">The destination buffer. After the copy, this will have <see cref="
VBuffer
{T}.Length"/>
223
public void CopyTo(ref
VBuffer
<T> destination, int sourceIndex, int length)
283
/// general expectation of sparse <see cref="
VBuffer
{T}"/> that the implicit sparse entries have the default value
321
public static void Copy(T[] source, int sourceIndex, ref
VBuffer
<T> destination, int length)
464
/// A helper method that gives us an iterable over the items given the fields from a <see cref="
VBuffer
{T}"/>.
466
/// <see cref="
VBuffer
{T}"/> itself, due to a bug in the C++/CLI compiler. (DevDiv 1097919:
468
/// <see cref="
VBuffer
{T}"/> in C++/CLI projects, we cannot have a generic struct with a nested class
VBufferEditor.cs (15)
20
/// of this passed in object, and so whatever <see cref="
VBuffer
{T}"/> was passed in as this parameter should not be used again, since its
23
scoped ref
VBuffer
<T> destination)
34
/// of this passed in object, and so whatever <see cref="
VBuffer
{T}"/> was passed in as this parameter should not be used again, since its
56
scoped ref
VBuffer
<T> destination,
73
/// An object capable of editing a <see cref="
VBuffer
{T}"/> by filling out
77
/// The <see cref="
VBuffer
{T}"/> structure by itself is immutable. However, the purpose of <see cref="
VBuffer
{T}"/>
79
/// <see cref="VBufferEditor.Create{T}(ref
VBuffer
{T}, int, int?, int?, bool, bool)"/> or
80
/// <see cref="VBufferEditor.CreateFromBuffer{T}(ref
VBuffer
{T})"/>.
130
/// Commits the edits and creates a new <see cref="
VBuffer
{T}"/> using the current <see cref="Values"/> and <see cref="Indices"/>.
133
/// <returns>The newly created <see cref="
VBuffer
{T}"/>.</returns>
134
public
VBuffer
<T> Commit()
140
/// Commits the edits and creates a new <see cref="
VBuffer
{T}"/> using
149
/// The newly created <see cref="
VBuffer
{T}"/>.
157
public
VBuffer
<T> CommitTruncated(int physicalValuesCount)
VectorType.cs (6)
15
/// The standard vector type. The representation type of this is <see cref="
VBuffer
{T}"/>,
27
/// has length greater than one, since <see cref="
VBuffer
{T}"/> itself is a single dimensional structure,
31
/// dimensions of <c>{ 5, 2 }</c>, then the <see cref="
VBuffer
{T}"/> values would be all of length <c>10</c>,
91
return typeof(
VBuffer
<>).MakeGenericType(itemType.RawType);
115
/// A vector whose size is known should correspond to values that always have the same <see cref="
VBuffer
{T}.Length"/>,
116
/// whereas one whose size is unknown may have values whose <see cref="
VBuffer
{T}.Length"/> varies from record to record.
Microsoft.ML.Ensemble (101)
EnsembleUtils.cs (4)
37
(in
VBuffer
<Single> src, ref
VBuffer
<Single> dst) => SelectFeatures(in src, features, card, ref dst));
47
public static void SelectFeatures<T>(in
VBuffer
<T> src, BitArray includedIndices, int cardinality, ref
VBuffer
<T> dst)
EntryPoints\CreateEnsemble.cs (1)
257
IOutputCombiner<
VBuffer
<Single>> combiner;
OutputCombiners\BaseMultiAverager.cs (2)
25
protected void CombineCore(ref
VBuffer
<Single> dst,
VBuffer
<Single>[] src, Single[] weights = null)
OutputCombiners\BaseMultiCombiner.cs (5)
68
public abstract Combiner<
VBuffer
<Single>> GetCombiner();
70
protected int GetClassCount(
VBuffer
<Single>[] values)
73
foreach (
var
item in values)
81
protected bool TryNormalize(
VBuffer
<Single>[] values)
98
protected void GetNaNOutput(ref
VBuffer
<Single> dst, int len)
OutputCombiners\BaseScalarStacking.cs (1)
24
protected override void FillFeatureBuffer(Single[] src, ref
VBuffer
<Single> dst)
OutputCombiners\BaseStacking.cs (10)
97
var map = mapper.GetMapper<
VBuffer
<Single>, TOutput>();
99
var
feat = default(
VBuffer
<Single>);
109
protected abstract void FillFeatureBuffer(TOutput[] src, ref
VBuffer
<Single> dst);
135
var maps = new ValueMapper<
VBuffer
<Single>, TOutput>[models.Count];
140
maps[i] = m.GetMapper<
VBuffer
<Single>, TOutput>();
152
private IDataView CreateDataView(IHostEnvironment env, IChannel ch, RoleMappedData data, ValueMapper<
VBuffer
<Single>,
169
private IDataView CreateDataView<T>(IHostEnvironment env, IChannel ch, RoleMappedData data, ValueMapper<
VBuffer
<Single>, TOutput>[] maps,
174
var features = new
VBuffer
<Single>[100];
180
var vBuffers = new
VBuffer
<Single>[maps.Length];
OutputCombiners\IOutputCombiner.cs (1)
46
internal interface IMulticlassOutputCombiner : IOutputCombiner<
VBuffer
<Single>>
OutputCombiners\MultiAverage.cs (3)
65
public override Combiner<
VBuffer
<Single>> GetCombiner()
69
(ref
VBuffer
<Single> dst,
VBuffer
<Single>[] src, Single[] weights) =>
OutputCombiners\MultiMedian.cs (3)
68
public override Combiner<
VBuffer
<Single>> GetCombiner()
72
(ref
VBuffer
<Single> dst,
VBuffer
<Single>[] src, Single[] weights) =>
OutputCombiners\MultiStacking.cs (5)
22
using TVectorTrainer = ITrainerEstimator<ISingleFeaturePredictionTransformer<IPredictorProducing<
VBuffer
<float>>>, IPredictorProducing<
VBuffer
<float>>>;
24
internal sealed class MultiStacking : BaseStacking<
VBuffer
<Single>>, IMulticlassOutputCombiner
80
protected override void FillFeatureBuffer(
VBuffer
<Single>[] src, ref
VBuffer
<Single> dst)
OutputCombiners\MultiVoting.cs (3)
67
public override Combiner<
VBuffer
<Single>> GetCombiner()
72
private void CombineCore(ref
VBuffer
<Single> dst,
VBuffer
<Single>[] src, Single[] weights = null)
OutputCombiners\MultiWeightedAverage.cs (1)
91
public override Combiner<
VBuffer
<Single>> GetCombiner()
PipelineEnsemble.cs (7)
260
private sealed class ImplVec : SchemaBindablePipelineEnsemble<
VBuffer
<Single>>
650
var
labelNames = default(
VBuffer
<T>);
654
var
curLabelNames = default(
VBuffer
<T>);
679
private static bool AreEqual<T>(in
VBuffer
<T> v1, in
VBuffer
<T> v2)
Selector\DiversityMeasure\MultiDisagreementDiversityMeasure.cs (3)
16
internal sealed class MultiDisagreementDiversityMeasure : BaseDisagreementDiversityMeasure<
VBuffer
<Single>>, IMulticlassDiversityMeasure
20
protected override Single GetDifference(in
VBuffer
<Single> valueX, in
VBuffer
<Single> valueY)
Selector\IDiversityMeasure.cs (1)
26
internal interface IMulticlassDiversityMeasure : IDiversityMeasure<
VBuffer
<Single>>
Selector\ISubModelSelector.cs (1)
31
internal interface IMulticlassSubModelSelector : ISubModelSelector<
VBuffer
<Single>>
Selector\SubModelSelector\AllSelectorMulticlass.cs (1)
16
internal sealed class AllSelectorMulticlass : BaseSubModelSelector<
VBuffer
<Single>>, IMulticlassSubModelSelector
Selector\SubModelSelector\BaseDiverseSelector.cs (1)
44
var map = vm.GetMapper<
VBuffer
<Single>, TOutput>();
Selector\SubModelSelector\BestDiverseSelectorMulticlass.cs (6)
21
internal sealed class BestDiverseSelectorMulticlass : BaseDiverseSelector<
VBuffer
<Single>, IDiversityMeasure<
VBuffer
<Single>>>, IMulticlassSubModelSelector
42
public override List<ModelDiversityMetric<
VBuffer
<Single>>> CalculateDiversityMeasure(IList<FeatureSubsetModel<
VBuffer
<float>>> models,
43
ConcurrentDictionary<FeatureSubsetModel<
VBuffer
<float>>,
VBuffer
<Single>[]> predictions)
Selector\SubModelSelector\BestPerformanceSelectorMulticlass.cs (1)
19
internal sealed class BestPerformanceSelectorMulticlass : BaseBestPerformanceSelector<
VBuffer
<Single>>, IMulticlassSubModelSelector
Trainer\EnsembleDistributionModelParameters.cs (13)
142
Host.Check(typeof(TIn) == typeof(
VBuffer
<Single>));
149
var vBuffers = new
VBuffer
<Single>[_mappers.Length];
150
ValueMapper<
VBuffer
<Single>, Single> del =
151
(in
VBuffer
<Single> src, ref Single dst) =>
156
var
tmp = src;
178
Host.Check(typeof(TIn) == typeof(
VBuffer
<Single>));
187
var vBuffers = new
VBuffer
<Single>[_mappers.Length];
188
ValueMapper<
VBuffer
<Single>, Single, Single> del =
189
(in
VBuffer
<Single> src, ref Single score, ref Single prob) =>
194
var
tmp = src;
214
private ValueMapper<
VBuffer
<Single>, Single, Single>[] GetMaps()
218
var maps = new ValueMapper<
VBuffer
<Single>, Single, Single>[_mappers.Length];
220
maps[i] = _mappers[i].GetMapper<
VBuffer
<Single>, Single, Single>();
Trainer\EnsembleModelParameters.cs (7)
132
Host.Check(typeof(TIn) == typeof(
VBuffer
<Single>));
137
var buffers = new
VBuffer
<Single>[_mappers.Length];
138
var maps = new ValueMapper<
VBuffer
<Single>, Single>[_mappers.Length];
140
maps[i] = _mappers[i].GetMapper<
VBuffer
<Single>, Single>();
142
ValueMapper<
VBuffer
<Single>, Single> del =
143
(in
VBuffer
<Single> src, ref Single dst) =>
148
var
tmp = src;
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (15)
17
internal sealed class EnsembleMulticlassModelParameters : EnsembleModelParametersBase<
VBuffer
<Single>>, IValueMapper
50
internal EnsembleMulticlassModelParameters(IHostEnvironment env, FeatureSubsetModel<
VBuffer
<float>>[] models,
112
Host.Check(typeof(TIn) == typeof(
VBuffer
<Single>));
113
Host.Check(typeof(TOut) == typeof(
VBuffer
<Single>));
116
var features = new
VBuffer
<Single>[_mappers.Length];
117
var predictions = new
VBuffer
<Single>[_mappers.Length];
118
var maps = new ValueMapper<
VBuffer
<Single>,
VBuffer
<Single>>[_mappers.Length];
124
maps[i] = _mappers[i].GetMapper<
VBuffer
<Single>,
VBuffer
<Single>>();
127
ValueMapper<
VBuffer
<Single>,
VBuffer
<Single>> del =
128
(in
VBuffer
<Single> src, ref
VBuffer
<Single> dst) =>
133
var
tmp = src;
Trainer\Multiclass\MulticlassDataPartitionEnsembleTrainer.cs (6)
26
using TVectorPredictor = IPredictorProducing<
VBuffer
<Single>>;
27
using TVectorTrainer = ITrainerEstimator<ISingleFeaturePredictionTransformer<IPredictorProducing<
VBuffer
<float>>>, IPredictorProducing<
VBuffer
<float>>>;
33
EnsembleTrainerBase<
VBuffer
<Single>,
90
private protected override IPredictor CreatePredictor(List<FeatureSubsetModel<
VBuffer
<float>>> models)
102
models.Select(k => new FeatureSubsetModel<
VBuffer
<float>>((TVectorPredictor)k)).ToArray(),
Microsoft.ML.EntryPoints (5)
FeatureCombiner.cs (2)
126
var
metadata = default(
VBuffer
<ReadOnlyMemory<char>>);
PermutationFeatureImportance.cs (3)
150
var pred = new MulticlassPredictionTransformer<IPredictorProducing<
VBuffer
<float>>>(
151
env, predictor as IPredictorProducing<
VBuffer
<float>>, roleMappedData.Data.Schema, featureColumnName, labelColumnName);
309
VBuffer
<ReadOnlyMemory<char>> slots = default;
Microsoft.ML.FastTree (119)
BinFile\BinFinder.cs (2)
54
private int FindDistinctCounts(in
VBuffer
<Double> values, double[] valueBuffer, double[] distinctValues, int[] counts)
227
public bool FindBins(in
VBuffer
<Double> values, int maxBins, int minPerLeaf, out double[] binUpperBounds)
FastTree.cs (62)
1002
private protected static bool CalculateBins(BinFinder binFinder, in
VBuffer
<double> values, int maxBins, int minDocsPerLeaf,
1024
ref int[] forwardIndexerWork, ref
VBuffer
<double> temp, bool categorical)
1189
private protected static SingletonFeatureFlock CreateSingletonFlock(IChannel ch, in
VBuffer
<double> values, int[] binnedValues,
1298
private ValueMapper<
VBuffer
<T1>,
VBuffer
<T2>> GetCopier<T1, T2>(DataViewType itemType1, DataViewType itemType2)
1303
ValueMapper<
VBuffer
<T1>,
VBuffer
<T1>> identityResult =
1304
(in
VBuffer
<T1> src, ref
VBuffer
<T1> dst) => src.CopyTo(ref dst);
1305
return (ValueMapper<
VBuffer
<T1>,
VBuffer
<T2>>)(object)identityResult;
1308
(in
VBuffer
<T1> src, ref
VBuffer
<T2> dst) =>
1373
VBuffer
<float> temp = default(
VBuffer
<float>);
1402
VBuffer
<double> doubleTemp = default(
VBuffer
<double>);
1470
VBuffer
<double> doubleTemp = default(
VBuffer
<double>);
1609
VBuffer
<ulong> groupIds = default(
VBuffer
<ulong>);
1641
private void GetFeatureValues(SlotCursor cursor, int iFeature, ValueGetter<
VBuffer
<float>> getter,
1642
ref
VBuffer
<float> temp, ref
VBuffer
<double> doubleTemp, ValueMapper<
VBuffer
<float>,
VBuffer
<double>> copier)
1659
private static ValueGetter<
VBuffer
<T>> SubsetGetter<T>(ValueGetter<
VBuffer
<T>> getter, SlotDropper slotDropper)
1672
ValueGetter<
VBuffer
<float>> getter, ref
VBuffer
<float> temp)
1713
private static void ConstructBoundariesAndQueryIds(in
VBuffer
<ulong> groupIds, out int[] boundariesArray, out ulong[] qidsArray)
1909
VBuffer
<double> temp = default(
VBuffer
<double>);
2070
VBuffer
<double> temp = default(
VBuffer
<double>);
2181
VBuffer
<double> temp = default(
VBuffer
<double>);
2509
public void CopyTo(int length, ref
VBuffer
<double> dst)
2913
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
2916
ValueMapper<
VBuffer
<float>, float> del = Map;
2920
private protected virtual void Map(in
VBuffer
<float> src, ref float dst)
2931
ValueMapper<TSrc,
VBuffer
<float>> IFeatureContributionMapper.GetFeatureContributionMapper<TSrc, TDst>(int top, int bottom, bool normalize)
2933
Host.Check(typeof(TSrc) == typeof(
VBuffer
<float>));
2934
Host.Check(typeof(TDst) == typeof(
VBuffer
<float>));
2939
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del =
2940
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
2945
return (ValueMapper<TSrc,
VBuffer
<float>>)(Delegate)del;
2948
private void FeatureContributionMap(in
VBuffer
<float> src, ref
VBuffer
<float> dst, ref BufferBuilder<float> builder)
3150
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
3182
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
3202
private void SaveTreeAsCode(InternalRegressionTree tree, TextWriter writer, in
VBuffer
<ReadOnlyMemory<char>> names)
3208
private void ToCSharp(InternalRegressionTree tree, TextWriter writer, int node, in
VBuffer
<ReadOnlyMemory<char>> names)
3232
/// <param name="weights">A <see cref="
VBuffer
{T}"/> to hold the cumulative split gain value for each feature.
3234
public void GetFeatureWeights(ref
VBuffer
<float> weights)
3272
internal int GetLeaf(int treeId, in
VBuffer
<float> features, ref List<int> path)
3277
private sealed class Tree : ITree<
VBuffer
<float>>
3294
public int GetLeaf(in
VBuffer
<float> feat)
FastTreeTweedie.cs (1)
548
private protected override void Map(in
VBuffer
<float> src, ref float dst)
GamModelParameters.cs (17)
195
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>), "Input type does not match.");
198
ValueMapper<
VBuffer
<float>, float> del = Map;
202
private void Map(in
VBuffer
<float> features, ref float response)
233
internal double GetFeatureBinsAndScore(in
VBuffer
<float> features, int[] bins)
372
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
402
ValueMapper<TSrc,
VBuffer
<float>> IFeatureContributionMapper.GetFeatureContributionMapper<TSrc, TDstContributions>
405
Host.Check(typeof(TSrc) == typeof(
VBuffer
<float>), "Source type does not match.");
406
Host.Check(typeof(TDstContributions) == typeof(
VBuffer
<float>), "Destination type does not match.");
408
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del =
409
(in
VBuffer
<float> srcFeatures, ref
VBuffer
<float> dstContributions) =>
413
return (ValueMapper<TSrc,
VBuffer
<float>>)(Delegate)del;
416
private void GetFeatureContributions(in
VBuffer
<float> features, ref
VBuffer
<float> contributions,
596
private readonly
VBuffer
<ReadOnlyMemory<char>> _featNames;
RandomForestRegression.cs (5)
232
private protected override void Map(in
VBuffer
<float> src, ref float dst)
243
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> IQuantileValueMapper.GetMapper(float[] quantiles)
246
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
TreeEnsemble\InternalQuantileRegressionTree.cs (1)
73
public void LoadSampledLabels(in
VBuffer
<float> feat, float[] distribution, float[] weights, int sampleCount, int destinationIndex)
TreeEnsemble\InternalRegressionTree.cs (5)
721
public virtual double GetOutput(in
VBuffer
<float> feat)
780
public int GetLeaf(in
VBuffer
<float> feat)
791
private int GetLeafFrom(in
VBuffer
<float> feat, int root)
809
public int GetLeaf(in
VBuffer
<float> feat, ref List<int> path)
1528
public void AppendFeatureContributions(in
VBuffer
<float> src, BufferBuilder<float> contributions)
TreeEnsemble\InternalTreeEnsemble.cs (6)
258
public double GetOutput(in
VBuffer
<float> feat)
266
public float[] GetDistribution(in
VBuffer
<float> feat, int sampleCount, out float[] weights)
347
internal void GetFeatureContributions(in
VBuffer
<float> features, ref
VBuffer
<float> contribs, ref BufferBuilder<float> builder)
426
private readonly
VBuffer
<ReadOnlyMemory<char>> _content;
427
private readonly
VBuffer
<ReadOnlyMemory<char>> _names;
TreeEnsembleFeaturizer.cs (16)
140
(ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>)owner.GetTreeSlotNames);
152
(ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>)owner.GetLeafSlotNames);
165
(ValueGetter<
VBuffer
<ReadOnlyMemory<char>>>)owner.GetPathSlotNames);
194
ValueGetter<
VBuffer
<float>> fn = state.GetTreeValues;
204
ValueGetter<
VBuffer
<float>> fn = state.GetLeafIds;
214
ValueGetter<
VBuffer
<float>> fn = state.GetPathIds;
232
private
VBuffer
<float> _src;
233
private readonly ValueGetter<
VBuffer
<float>> _featureGetter;
255
_src = default(
VBuffer
<float>);
256
_featureGetter = input.GetGetter<
VBuffer
<float>>(input.Schema[featureIndex]);
268
public void GetTreeValues(ref
VBuffer
<float> dst)
278
public void GetLeafIds(ref
VBuffer
<float> dst)
305
public void GetPathIds(ref
VBuffer
<float> dst)
474
private void GetTreeSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> dst)
485
private void GetLeafSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> dst)
502
private void GetPathSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> dst)
Utils\RegressionTreeBaseUtils.cs (4)
38
var categoricalSplitFeatures = new List<
VBuffer
<int>>();
39
var categoricalCategoricalSplitFeatureRange = new List<
VBuffer
<int>>();
118
var leafSamples = new List<
VBuffer
<double>>();
121
var leafSampleWeights = new List<
VBuffer
<double>>();
Microsoft.ML.ImageAnalytics (8)
ImageLoader.cs (3)
271
ValueGetter<
VBuffer
<byte>> del =
272
(ref
VBuffer
<byte> dst) =>
297
private static bool TryLoadDataIntoBuffer(string path, ref
VBuffer
<byte> imgData)
ImagePixelExtractor.cs (2)
305
private ValueGetter<
VBuffer
<TValue>> GetGetterCore<TValue>(DataViewRow input, int iinfo, out Action disposer)
337
(ref
VBuffer
<TValue> dst) =>
VectorToImageTransform.cs (3)
349
var
src = default(
VBuffer
<TValue>);
364
VBuffer
<TValue> dense = default;
Microsoft.ML.IntegrationTests (10)
Common.cs (1)
38
var vBufferType = typeof(
VBuffer
<>);
Explainability.cs (2)
128
var
weights = new VBuffer<float>();
155
var
weights = new VBuffer<float>();
IntrospectiveTraining.cs (3)
351
VBuffer
<ReadOnlyMemory<char>> categoricalSlotNames = new VBuffer<ReadOnlyMemory<char>>();
407
VBuffer
<float>[] centroids = default;
412
VBuffer
<float>[] weights = default;
ModelFiles.cs (1)
306
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
Training.cs (3)
279
VBuffer
<float>[] firstModelWeights = null;
284
VBuffer
<float>[] firstModelWeightsPrime = null;
289
VBuffer
<float>[] secondModelWeights = null;
Microsoft.ML.KMeansClustering (61)
KMeansModelParameters.cs (14)
29
ModelParametersBase<
VBuffer
<float>>,
62
private readonly
VBuffer
<float>[] _centroids;
75
internal KMeansModelParameters(IHostEnvironment env, int k,
VBuffer
<float>[] centroids, bool copyIn)
86
_centroids = new
VBuffer
<float>[_k];
127
_centroids = new
VBuffer
<float>[_k];
149
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
150
Host.Check(typeof(TOut) == typeof(
VBuffer
<float>));
152
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del =
153
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
165
private void Map(in
VBuffer
<float> src, Span<float> distances)
280
public void GetClusterCentroids(ref
VBuffer
<float>[] centroids, out int k)
325
foreach (
var
centriod in _centroids)
KMeansPlusPlusTrainer.cs (47)
221
var centroids = new
VBuffer
<float>[_k];
335
int k, int dimensionality,
VBuffer
<float>[] centroids,
347
var
candidate = default(
VBuffer
<float>);
632
public void SetClusterDistance(int newClusterIdxWithinSample, in
VBuffer
<float> newClusterFeatures, float newClusterL2,
633
int oldClusterIdx, in
VBuffer
<float> oldClusterFeatures, float oldClusterL2)
684
private static void FindBestCluster(in
VBuffer
<float> point, int pointRowIndex, SharedState initializationState,
685
int clusterCount, int clusterPrevCount,
VBuffer
<float>[] clusters, float[] clustersL2s, bool needRealDistanceSquared, bool needToStoreWeight,
786
int k, int dimensionality,
VBuffer
<float>[] centroids, long accelMemBudgetMb,
831
VBuffer
<float>[] clusters = new
VBuffer
<float>[totalSamples];
845
(in
VBuffer
<float> point, int pointIndex) => (float)1.0, (FeatureFloatVectorCursor cur) => -1,
872
VBuffer
<float>[] roundSamples = new
VBuffer
<float>[numSamplesPerRound];
874
KMeansUtils.WeightFunc weightFn = (in
VBuffer
<float> point, int pointRowIndex) =>
918
(ref
VBuffer
<float> point, int pointRowIndex, float[] weights, Random rand) =>
945
(ref
VBuffer
<float> point, int discard, float[] weights, Random rand) => weights[KMeansUtils.FindBestCluster(in point, clusters, clustersL2s)]++,
993
int k,
VBuffer
<float>[] centroids,
999
VBuffer
<float>[] outCentroids = null;
1001
(in
VBuffer
<float> point, int pointRowIndex) => 1f, (FeatureFloatVectorCursor cur) => -1,
1020
protected readonly
VBuffer
<float>[] Centroids;
1025
protected readonly
VBuffer
<float>[] CachedSum;
1028
public
VBuffer
<float>[] CachedSumDebug { get { return CachedSum; } }
1059
Centroids = new
VBuffer
<float>[k];
1067
CachedSum = new
VBuffer
<float>[k];
1112
public void UpdateClusterAssignment(bool firstIteration, in
VBuffer
<float> features, int cluster, int previousCluster, float distance)
1133
public void UpdateClusterAssignment(in
VBuffer
<float> features, int cluster, float distance)
1203
public void UpdateClusters(
VBuffer
<float>[] centroids, float[] centroidL2s, float[] deltas, ref float deltaMax)
1298
public int SetYinYangCluster(int n, in
VBuffer
<float> features, float minDistance, int minCluster, float secMinDistance)
1334
public void AssertValidYinYangBounds(int n, in
VBuffer
<float> features,
VBuffer
<float>[] centroids)
1353
long accelMemBudgetInMb, float convergenceThreshold,
VBuffer
<float>[] centroids)
1413
var cachedSumCopy = new
VBuffer
<float>[k];
1488
private static void ProcessChunk(FeatureFloatVectorCursor cursor, SharedState state, WorkChunkStateBase chunkState, int k,
VBuffer
<float>[] centroids, float[] centroidL2s)
1567
public
VBuffer
<float> Point;
1576
public delegate float WeightFunc(in
VBuffer
<float> point, int pointRowIndex);
1596
ref
VBuffer
<float>[] dst,
1615
(ref
VBuffer
<float> point, int pointRowIndex, Heap<WeightedPoint> heap, Random rand) =>
1690
public delegate void MapAction<TPartitionState>(ref
VBuffer
<float> point, int rowIndex, TPartitionState state, Random rand);
1754
public static int FindBestCluster(in
VBuffer
<float> features,
VBuffer
<float>[] centroids, float[] centroidL2s)
1764
public static int FindBestCluster(in
VBuffer
<float> features,
VBuffer
<float>[] centroids, float[] centroidL2s, int centroidCount, bool realWeight, out float minDistance)
1788
in
VBuffer
<float> features,
1789
VBuffer
<float>[] centroids, float[] centroidL2s, int centroidCount, bool needRealDistance,
1837
public static void VerifyModelConsistency(
VBuffer
<float>[] centroids)
1839
foreach (
var
centroid in centroids)
Microsoft.ML.LightGbm (1)
LightGbmMulticlassTrainer.cs (1)
52
VBuffer
<float>,
Microsoft.ML.Mkl.Components (22)
ComputeLRTrainingStdThroughHal.cs (1)
27
public override
VBuffer
<float> ComputeStandardDeviation(double[] hessian, int[] weightIndices, int numSelectedParams, int currentWeightsCount, IChannel ch, float l2Weight)
OlsLinearRegression.cs (7)
445
var
weights = new VBuffer<float>(weightsValues.Length, weightsValues);
460
var lrMap = lrPredictor.GetMapper<
VBuffer
<float>, float>();
464
var
features = cursor.Features;
763
/// of the i-th feature. Note that this will take ownership of the <see cref="
VBuffer
{T}"/>.</param>
770
internal OlsModelParameters(IHostEnvironment env, in
VBuffer
<float> weights, float bias,
901
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
SymSgdClassificationTrainer.cs (3)
251
private TPredictor CreatePredictor(
VBuffer
<float> weights, float bias)
255
VBuffer
<float> maybeSparseWeights = default;
711
VBuffer
<float> weights = default;
VectorWhitening.cs (11)
337
var getters = new ValueGetter<
VBuffer
<float>>[columns.Length];
339
getters[i] = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[cols[i]]);
340
var
val = default(
VBuffer
<float>);
605
var getSrc = GetSrcGetter<
VBuffer
<float>>(input, iinfo);
606
var
src = default(
VBuffer
<float>);
613
ValueGetter<
VBuffer
<float>> del =
614
(ref
VBuffer
<float> dst) =>
680
private static void FillValues(float[] model, ref
VBuffer
<float> src, ref
VBuffer
<float> dst, int cdst)
Microsoft.ML.OnnxConverter (1)
SaveOnnxCommand.cs (1)
224
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
Microsoft.ML.OnnxTransformer (11)
OnnxTransform.cs (10)
595
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
713
ValueGetter<
VBuffer
<T>> valueGetter = (ref
VBuffer
<T> dst) =>
733
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> valueGetter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
867
private readonly ValueGetter<
VBuffer
<T>> _srcGetter;
870
private
VBuffer
<T> _vBuffer;
871
private
VBuffer
<T> _vBufferDense;
878
_srcGetter = input.GetGetter<
VBuffer
<T>>(input.Schema[colIndex]);
OnnxTypeParser.cs (1)
89
Type tensorType = typeof(
VBuffer
<>);
Microsoft.ML.OnnxTransformerTest (31)
DnnImageFeaturizerTest.cs (5)
119
var
buffer = default(
VBuffer
<float>);
120
var getter = cursor.GetGetter<
VBuffer
<float>>(result.Schema["output_1"]);
165
VBuffer
<float> softMaxValue = default;
166
var softMaxGetter = cursor.GetGetter<
VBuffer
<float>>(loadedView.Schema[outputNames]);
OnnxTransformTests.cs (26)
210
VBuffer
<float> softMaxValue = default;
211
var softMaxGetter = cursor.GetGetter<
VBuffer
<float>>(sofMaxOut1Col);
274
var
buffer = default(
VBuffer
<float>);
275
var getter = cursor.GetGetter<
VBuffer
<float>>(softmaxOutCol);
325
var
buffer = default(
VBuffer
<float>);
326
var getter = cursor.GetGetter<
VBuffer
<float>>(softmaxOutCol);
376
var getScores = curs.GetGetter<
VBuffer
<float>>(scoreCol);
377
var
buffer = default(
VBuffer
<float>);
444
var getScoresa = curs.GetGetter<
VBuffer
<float>>(outaCol);
445
var getScoresb = curs.GetGetter<
VBuffer
<float>>(outbCol);
446
var
buffera = default(
VBuffer
<float>);
447
var
bufferb = default(
VBuffer
<float>);
484
var getScoresa = curs.GetGetter<
VBuffer
<float>>(outaCol);
485
var getScoresb = curs.GetGetter<
VBuffer
<float>>(outbCol);
486
var
buffera = default(
VBuffer
<float>);
487
var
bufferb = default(
VBuffer
<float>);
509
var getScoresb = curs.GetGetter<
VBuffer
<float>>(outbCol);
510
var
bufferb = default(
VBuffer
<float>);
Microsoft.ML.Parquet (2)
ParquetLoader.cs (2)
519
return CreateGetterDelegateCore<byte[],
VBuffer
<Byte>>(col, _parquetConversions.Conv);
691
public void Conv(in byte[] src, ref
VBuffer
<Byte> dst) => dst = src != null ? new VBuffer<byte>(src.Length, src) : new VBuffer<byte>(0, new byte[0]);
Microsoft.ML.PCA (25)
PcaTrainer.cs (14)
298
private static void Project(IHost host, FeatureFloatVectorCursor.Factory cursorFactory, ref
VBuffer
<float> mean, float[][] omega, float[][] y, out long numBad)
436
private readonly
VBuffer
<float>[] _eigenVectors; // top-k eigenvectors of the train data's covariance matrix
438
private readonly
VBuffer
<float> _mean; // used to compute (x-mu)^2
452
internal PcaModelParameters(IHostEnvironment env, int rank, float[][] eigenVectors, in
VBuffer
<float> mean)
457
_eigenVectors = new
VBuffer
<float>[rank];
505
_eigenVectors = new
VBuffer
<float>[_rank];
591
var cols = new
VBuffer
<float>[_rank + 1];
619
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
622
ValueMapper<
VBuffer
<float>, float> del =
623
(in
VBuffer
<float> src, ref float dst) =>
631
private float Score(in
VBuffer
<float> src)
636
var
mean = _mean;
662
public void GetEigenVectors(ref
VBuffer
<float>[] vectors, out int rank)
673
public void GetMean(ref
VBuffer
<float> mean)
PcaTransformer.cs (11)
420
var columnGetters = new ValueGetter<
VBuffer
<float>>[_numColumns];
426
columnGetters[iinfo] = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[sInfo.InputIndex]);
429
var
features = default(
VBuffer
<float>);
575
var srcGetter = input.GetGetter<
VBuffer
<float>>(input.Schema[ColMapNewToOld[iinfo]]);
576
var
src = default(
VBuffer
<float>);
578
ValueGetter<
VBuffer
<float>> dstGetter = (ref
VBuffer
<float> dst) =>
587
private static void TransformFeatures(IExceptionContext ectx, in
VBuffer
<float> src, ref
VBuffer
<float> dst, TransformInfo transformInfo)
Microsoft.ML.PerformanceTests (5)
HashBench.cs (5)
78
private ValueGetter<
VBuffer
<uint>> _vecGetter;
92
_vecGetter = outRow.GetGetter<
VBuffer
<uint>>(column);
109
_vecGetter = outRow.GetGetter<
VBuffer
<uint>>(column);
129
var
vbuf = new VBuffer<T>(vals.Length, vals);
138
VBuffer
<uint> val = default;
Microsoft.ML.Predictor.Tests (14)
TestPredictors.cs (7)
894
curs.GetGetter<
VBuffer
<float>>(scoreCol) :
895
(ref
VBuffer
<float> dst) => dst = default;
904
var vectorScoreGetters = new ValueGetter<
VBuffer
<float>>[predCount];
913
cursors[i].GetGetter<
VBuffer
<float>>(scoreColArray[i].Value) :
914
(ref
VBuffer
<float> dst) => dst = default;
924
VBuffer
<float> vectorScore = default;
928
var vectorScores = new
VBuffer
<float>[predCount];
TestTransposer.cs (7)
38
var getter = cursor.GetGetter<
VBuffer
<T>>(cursor.Schema[col]);
39
VBuffer
<T> temp = default;
89
VBuffer
<T> temp = default(
VBuffer
<T>);
105
private static
VBuffer
<T>[] GenerateHelper<T>(
109
VBuffer
<T>[] vecs = new
VBuffer
<T>[rowCount];
Microsoft.ML.Samples (50)
Dynamic\DataOperations\LoadingSvmLight.cs (2)
94
var featuresGetter = cursor.GetGetter<
VBuffer
<float>>(svmData.Schema["Features"]);
96
VBuffer
<float> features = default;
Dynamic\ModelOperations\OnnxConversion.cs (1)
19
public
VBuffer
<float> Score { get; set; }
Dynamic\NgramExtraction.cs (6)
66
Action<string, IEnumerable<
VBuffer
<float>>,
67
VBuffer
<ReadOnlyMemory<char>>>
75
foreach (
var
featureRow in column)
87
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
92
.GetColumn<
VBuffer
<float>>(transformedData_onechars
103
.GetColumn<
VBuffer
<float>>(transformedData_twochars
Dynamic\SimpleDataViewImplementation.cs (3)
50
VBuffer
<ReadOnlyMemory<char>> tokensValue = default;
56
.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(tokensColumn);
216
/// valuable in the case of buffer sharing for <see cref="
VBuffer
{T}"/>,
Dynamic\TextTransform.cs (4)
76
Action<string, IEnumerable<
VBuffer
<float>>> printHelper = (columnName,
83
foreach (
var
featureRow in column)
98
.GetColumn<
VBuffer
<float>>(transformedData_default
112
.GetColumn<
VBuffer
<float>>(transformedData_customized
Dynamic\Trainers\Clustering\KMeans.cs (1)
75
VBuffer
<float>[] centroids = default;
Dynamic\Trainers\Clustering\KMeansWithOptions.cs (1)
83
VBuffer
<float>[] centroids = default;
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
131
VBuffer
<ReadOnlyMemory<char>> keys = default;
Dynamic\Trainers\MulticlassClassification\LogLossPerClass.cs (1)
51
VBuffer
<uint> keys = default;
Dynamic\Trainers\Regression\LightGbmAdvanced.cs (1)
52
VBuffer
<float> weights = default;
Dynamic\Trainers\Regression\LightGbmWithOptionsAdvanced.cs (1)
61
VBuffer
<float> weights = default;
Dynamic\Transforms\Conversion\Hash.cs (1)
79
var
slotNames = new VBuffer<ReadOnlyMemory<char>>();
Dynamic\Transforms\Conversion\HashWithOptions.cs (1)
93
var
slotNames = new VBuffer<ReadOnlyMemory<char>>();
Dynamic\Transforms\Conversion\KeyToValueToKey.cs (2)
91
var originalColumnBack = transformedDataDefault.GetColumn<
VBuffer
<
95
foreach (
var
row in originalColumnBack)
Dynamic\Transforms\ImageAnalytics\ConvertToImage.cs (4)
59
VBuffer
<float> features = default;
60
VBuffer
<float> pixels = default;
63
var featuresGetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[
66
var pixelsGetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[
Dynamic\Transforms\ImageAnalytics\ExtractPixels.cs (2)
83
VBuffer
<float> pixels = default;
97
var pixelsGetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[
Dynamic\Transforms\Projection\VectorWhiten.cs (3)
36
Action<string, IEnumerable<
VBuffer
<float>>> printHelper = (colName,
42
foreach (
var
row in column)
57
var whitening = transformedData.GetColumn<
VBuffer
<float>>(
Dynamic\Transforms\Projection\VectorWhitenWithOptions.cs (3)
35
Action<string, IEnumerable<
VBuffer
<float>>> printHelper = (colName,
41
foreach (
var
row in column)
57
var whitening = transformedData.GetColumn<
VBuffer
<float>>(
Dynamic\Transforms\Text\ProduceHashedNgrams.cs (3)
75
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
77
var NgramFeaturesColumn = transformedDataView.GetColumn<
VBuffer
<float>>(
82
foreach (
var
featureRow in NgramFeaturesColumn)
Dynamic\Transforms\Text\ProduceHashedWordBags.cs (3)
74
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
78
var BagOfWordFeaturesColumn = transformedDataView.GetColumn<
VBuffer
<
83
foreach (
var
featureRow in BagOfWordFeaturesColumn)
Dynamic\Transforms\Text\ProduceNgrams.cs (3)
83
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
85
var NgramFeaturesColumn = transformedDataView.GetColumn<
VBuffer
<
89
foreach (
var
featureRow in NgramFeaturesColumn)
Dynamic\Transforms\Text\ProduceWordBags.cs (3)
80
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
84
var BagOfWordFeaturesColumn = transformedDataView.GetColumn<
VBuffer
<
89
foreach (
var
featureRow in BagOfWordFeaturesColumn)
Microsoft.ML.Samples.GPU (1)
docs\samples\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
131
VBuffer
<ReadOnlyMemory<char>> keys = default;
Microsoft.ML.StandardTrainers (486)
FactorizationMachine\FactorizationMachineTrainer.cs (6)
360
int latentDimAligned, AlignedArray latentSum, int[] featureFieldBuffer, int[] featureIndexBuffer, float[] featureValueBuffer,
VBuffer
<float> buffer, ref long badExampleCount)
363
var getters = new ValueGetter<
VBuffer
<float>>[featureColumns.Count];
382
getters[f] = cursor.GetGetter<
VBuffer
<float>>(featureColumns[f]);
457
var featureGetters = new ValueGetter<
VBuffer
<float>>[fieldCount];
458
var
featureBuffer = new VBuffer<float>();
494
featureGetters[i] = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[fieldColumnIndexes[i]]);
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (2)
227
internal float CalculateResponse(ValueGetter<
VBuffer
<float>>[] getters,
VBuffer
<float> featureBuffer,
FactorizationMachine\FieldAwareFactorizationMachineUtils.cs (5)
26
internal static bool LoadOneExampleIntoBuffer(ValueGetter<
VBuffer
<float>>[] getters,
VBuffer
<float> featureBuffer, bool norm, ref int count,
102
var
featureBuffer = new VBuffer<float>();
106
var inputGetters = new ValueGetter<
VBuffer
<float>>[_pred.FieldCount];
115
inputGetters[f] = input.GetGetter<
VBuffer
<float>>(input.Schema[_inputColumnIndexes[f]]);
LdSvm\LdSvmModelParameters.cs (18)
42
private readonly
VBuffer
<float>[] _w;
43
private readonly
VBuffer
<float>[] _thetaPrime;
44
private readonly
VBuffer
<float>[] _theta;
50
/// Constructor. w, thetaPrime, theta must be dense <see cref="
VBuffer
{T}"/>s.
53
internal LdSvmModelParameters(IHostEnvironment env,
VBuffer
<float>[] w,
VBuffer
<float>[] thetaPrime,
VBuffer
<float>[] theta,
202
/// Save an array of <see cref="
VBuffer
{T}"/> in binary format. The vectors must be dense.
206
private void SaveVBufferArray(ModelSaveContext ctx,
VBuffer
<float>[] data)
214
var
vector = data[i];
222
/// Load an array of <see cref="
VBuffer
{T}"/> from binary format.
228
private
VBuffer
<float>[] LoadVBufferArray(ModelLoadContext ctx, int length, int vectorLength)
233
VBuffer
<float>[] result = new
VBuffer
<float>[length];
247
private float Margin(in
VBuffer
<float> src)
270
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
273
ValueMapper<
VBuffer
<float>, float> del =
274
(in
VBuffer
<float> src, ref float dst) =>
LdSvm\LdSvmTrainer.cs (26)
205
private void ComputeGradTheta(in
VBuffer
<float> feat, float[] gradTheta, int numLeaf, float gamma,
206
VBuffer
<float>[] theta, float[] biasTheta, float[] pathWt, float[] localWt,
VBuffer
<float>[] w, float[] biasW)
229
private void UpdateGamma(int iter, int numLeaf, ref float gamma, Data data,
VBuffer
<float>[] theta, float[] biasTheta)
238
foreach (
var
s in sample)
257
var w = new
VBuffer
<float>[numNodes];
258
var thetaPrime = new
VBuffer
<float>[numNodes];
259
var theta = new
VBuffer
<float>[numLeaf - 1];
264
var tempW = new
VBuffer
<float>[numNodes];
265
var tempThetaPrime = new
VBuffer
<float>[numNodes];
266
var tempTheta = new
VBuffer
<float>[numLeaf - 1];
317
var
features = s.Features;
400
private void InitClassifierParam(int numLeaf, int numFeatures,
VBuffer
<float>[] tempW,
VBuffer
<float>[] w,
401
VBuffer
<float>[] theta,
VBuffer
<float>[] thetaPrime, float[] biasW, float[] biasTheta,
402
float[] biasThetaPrime,
VBuffer
<float>[] tempThetaPrime,
VBuffer
<float>[] tempTheta,
483
public
VBuffer
<float> Features;
497
public abstract IEnumerable<
VBuffer
<float>> SampleForGammaUpdate(Random rand);
547
public override IEnumerable<
VBuffer
<float>> SampleForGammaUpdate(Random rand)
582
public override IEnumerable<
VBuffer
<float>> SampleForGammaUpdate(Random rand)
593
var getter = cursor.GetGetter<
VBuffer
<float>>(_data.Data.Schema[_data.Schema.Feature.Value.Name]);
594
var
features = default(
VBuffer
<float>);
636
var featureGetter = cursor.GetGetter<
VBuffer
<float>>(featureCol);
Optimizer\DifferentiableFunction.cs (40)
21
internal delegate float DifferentiableFunction(in
VBuffer
<float> input, ref
VBuffer
<float> gradient, IProgressChannelProvider progress);
33
internal delegate float IndexedDifferentiableFunction(int index, in
VBuffer
<float> input, ref
VBuffer
<float> gradient);
45
private readonly
VBuffer
<float>[] _tempGrads;
46
private
VBuffer
<float> _input;
70
_tempGrads = new
VBuffer
<float>[threads];
100
VBuffer
<float> tempGrad = default(
VBuffer
<float>);
120
public float Eval(in
VBuffer
<float> input, ref
VBuffer
<float> gradient)
171
public static float Test(DifferentiableFunction f, in
VBuffer
<float> x)
184
public static float Test(DifferentiableFunction f, in
VBuffer
<float> x, bool quiet)
187
VBuffer
<float> grad = default(
VBuffer
<float>);
188
VBuffer
<float> newGrad = default(
VBuffer
<float>);
189
VBuffer
<float> newX = default(
VBuffer
<float>);
214
VBuffer
<float> dir = new VBuffer<float>(x.Length, values.Count, values.ToArray(), indices.ToArray());
249
public static void TestAllCoords(DifferentiableFunction f, in
VBuffer
<float> x)
252
VBuffer
<float> grad = default(
VBuffer
<float>);
253
VBuffer
<float> newGrad = default(
VBuffer
<float>);
254
VBuffer
<float> newX = default(
VBuffer
<float>);
262
VBuffer
<float> dir = new VBuffer<float>(x.Length, 1, new float[] { 1 }, new int[] { 0 });
288
public static void TestCoords(DifferentiableFunction f, in
VBuffer
<float> x, IList<int> coords)
291
VBuffer
<float> grad = default(
VBuffer
<float>);
292
VBuffer
<float> newGrad = default(
VBuffer
<float>);
293
VBuffer
<float> newX = default(
VBuffer
<float>);
301
VBuffer
<float> dir = new VBuffer<float>(x.Length, 1, new float[] { 1 }, new int[] { 0 });
330
public static float Test(DifferentiableFunction f, in
VBuffer
<float> x, ref
VBuffer
<float> dir, bool quiet,
331
ref
VBuffer
<float> newGrad, ref
VBuffer
<float> newX)
Optimizer\L1Optimizer.cs (6)
44
internal override OptimizerState MakeState(IChannel ch, IProgressChannelProvider progress, DifferentiableFunction function, ref
VBuffer
<float> initial)
75
internal L1OptimizerState(IChannel ch, IProgressChannelProvider progress, DifferentiableFunction function, in
VBuffer
<float> initial, int m, long totalMemLimit,
98
private float EvalCore(in
VBuffer
<float> input, ref
VBuffer
<float> gradient, IProgressChannelProvider progress)
123
public override float Eval(in
VBuffer
<float> input, ref
VBuffer
<float> gradient)
Optimizer\LineSearch.cs (13)
442
private static readonly
VBuffer
<float> _c1;
443
private static readonly
VBuffer
<float> _c2;
444
private static readonly
VBuffer
<float> _c3;
462
private static float QuadTest2D(in
VBuffer
<float> x, ref
VBuffer
<float> grad, IProgressChannelProvider progress = null)
473
private static void StochasticQuadTest2D(in
VBuffer
<float> x, ref
VBuffer
<float> grad)
478
private static void CreateWrapped(out
VBuffer
<float> vec, params float[] values)
510
VBuffer
<float> grad = VBufferUtils.CreateEmpty<float>(2);
514
(in
VBuffer
<float> x) =>
523
VBuffer
<float> init;
525
VBuffer
<float> ans = default(
VBuffer
<float>);
Optimizer\OptimizationMonitor.cs (6)
46
private
VBuffer
<float> _newGrad;
47
private
VBuffer
<float> _newX;
87
VBuffer
<float> x = state.X;
88
var
lastDir = state.LastDir;
322
var
gradient = state.Grad;
379
var
grad = state.Grad;
Optimizer\Optimizer.cs (29)
93
internal virtual OptimizerState MakeState(IChannel ch, IProgressChannelProvider progress, DifferentiableFunction function, ref
VBuffer
<float> initial)
102
internal FunctionOptimizerState(IChannel ch, IProgressChannelProvider progress, DifferentiableFunction function, in
VBuffer
<float> initial, int m,
110
public override float Eval(in
VBuffer
<float> input, ref
VBuffer
<float> gradient)
122
protected internal
VBuffer
<float> _x;
123
protected internal
VBuffer
<float> _grad;
124
protected internal
VBuffer
<float> _newX;
125
protected internal
VBuffer
<float> _newGrad;
126
protected internal
VBuffer
<float> _dir;
127
protected internal
VBuffer
<float> _steepestDescDir;
143
public abstract float Eval(in
VBuffer
<float> input, ref
VBuffer
<float> gradient);
148
public
VBuffer
<float> X { get { return _newX; } }
153
public
VBuffer
<float> Grad { get { return _newGrad; } }
158
public
VBuffer
<float> LastDir { get { return _dir; } }
189
private readonly
VBuffer
<float>[] _sList;
190
private readonly
VBuffer
<float>[] _yList;
196
protected internal OptimizerState(IChannel ch, IProgressChannelProvider progress, in
VBuffer
<float> initial,
220
_sList = new
VBuffer
<float>[_m];
221
_yList = new
VBuffer
<float>[_m];
231
protected
VBuffer
<float> CreateWorkingVector()
338
VBuffer
<float> nextS;
339
VBuffer
<float> nextY;
573
public void Minimize(DifferentiableFunction function, ref
VBuffer
<float> initial, float tolerance, ref
VBuffer
<float> result, out float optimum)
587
public void Minimize(DifferentiableFunction function, ref
VBuffer
<float> initial, ref
VBuffer
<float> result, out float optimum)
601
public void Minimize(DifferentiableFunction function, ref
VBuffer
<float> initial, ITerminationCriterion term, ref
VBuffer
<float> result, out float optimum)
Optimizer\SgdOptimizer.cs (26)
17
internal delegate bool DTerminate(in
VBuffer
<float> x);
158
public delegate void DStochasticGradient(in
VBuffer
<float> x, ref
VBuffer
<float> grad);
166
public void Minimize(DStochasticGradient f, ref
VBuffer
<float> initial, ref
VBuffer
<float> result)
171
VBuffer
<float> grad = VBufferUtils.CreateEmpty<float>(dim);
172
VBuffer
<float> step = VBufferUtils.CreateEmpty<float>(dim);
173
VBuffer
<float> x = default(
VBuffer
<float>);
175
VBuffer
<float> prev = default(
VBuffer
<float>);
176
VBuffer
<float> avg = VBufferUtils.CreateEmpty<float>(dim);
299
private
VBuffer
<float> _point;
300
private
VBuffer
<float> _newPoint;
301
private
VBuffer
<float> _grad;
302
private
VBuffer
<float> _newGrad;
303
private
VBuffer
<float> _dir;
305
public
VBuffer
<float> NewPoint => _newPoint;
316
public LineFunc(DifferentiableFunction function, in
VBuffer
<float> initial, bool useCG = false)
363
public void Minimize(DifferentiableFunction function, in
VBuffer
<float> initial, ref
VBuffer
<float> result)
367
VBuffer
<float> prev = default(
VBuffer
<float>);
373
var
newPoint = lineFunc.NewPoint;
396
internal static bool ShouldTerminate(in
VBuffer
<float> x, in
VBuffer
<float> xprev)
Standard\LinearModelParameters.cs (49)
57
private protected readonly
VBuffer
<float> Weight;
60
private
VBuffer
<float> _weightsDense;
118
/// of the i-th feature. Note that this will take ownership of the <see cref="
VBuffer
{T}"/>.</param>
120
internal LinearModelParameters(IHostEnvironment env, string name, in
VBuffer
<float> weights, float bias)
264
private protected virtual float Score(in
VBuffer
<float> src)
268
var
weights = Weight;
275
private protected virtual void GetFeatureContributions(in
VBuffer
<float> features, ref
VBuffer
<float> contributions, int top, int bottom, bool normalize)
280
var
weights = Weight;
311
Contracts.Check(typeof(TIn) == typeof(
VBuffer
<float>));
314
ValueMapper<
VBuffer
<float>, float> del =
315
(in
VBuffer
<float> src, ref float dst) =>
327
private protected void CombineParameters(IList<IParameterMixer<float>> models, out
VBuffer
<float> weights, out float bias)
334
weights = default(
VBuffer
<float>);
344
var
subweights = sub.Weight;
365
var
weights = Weight;
376
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
379
subBuilder.AddSlotNames(Weight.Length, (ref
VBuffer
<ReadOnlyMemory<char>> dst) => names.CopyTo(ref dst));
383
builder.Add("Weights", colType, (ref
VBuffer
<float> dst) => Weight.CopyTo(ref dst), subBuilder.ToAnnotations());
397
void IHaveFeatureWeights.GetFeatureWeights(ref
VBuffer
<float> weights)
402
ValueMapper<TSrc,
VBuffer
<float>> IFeatureContributionMapper.GetFeatureContributionMapper<TSrc, TDstContributions>(int top, int bottom, bool normalize)
404
Contracts.Check(typeof(TSrc) == typeof(
VBuffer
<float>));
405
Contracts.Check(typeof(TDstContributions) == typeof(
VBuffer
<float>));
407
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del =
408
(in
VBuffer
<float> src, ref
VBuffer
<float> dstContributions) =>
412
return (ValueMapper<TSrc,
VBuffer
<float>>)(Delegate)del;
447
/// of the i-th feature. Note that this will take ownership of the <see cref="
VBuffer
{T}"/>.</param>
450
internal LinearBinaryModelParameters(IHostEnvironment env, in
VBuffer
<float> weights, float bias, ModelStatisticsBase stats = null)
517
VBuffer
<float> weights;
528
var
weights = Weight;
540
var
weights = Weight;
551
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
563
var
weights = Weight;
575
private protected RegressionModelParameters(IHostEnvironment env, string name, in
VBuffer
<float> weights, float bias)
600
var
weights = Weight;
632
/// of the i-th feature. Note that this will take ownership of the <see cref="
VBuffer
{T}"/>.</param>
634
internal LinearRegressionModelParameters(IHostEnvironment env, in
VBuffer
<float> weights, float bias)
664
var
weights = Weight;
674
VBuffer
<float> weights;
685
var
weights = Weight;
718
/// of the i-th feature. Note that this will take ownership of the <see cref="
VBuffer
{T}"/>.</param>
720
internal PoissonRegressionModelParameters(IHostEnvironment env, in
VBuffer
<float> weights, float bias)
754
private protected override float Score(in
VBuffer
<float> src)
765
var
weights = Weight;
775
VBuffer
<float> weights;
Standard\LinearPredictorUtils.cs (12)
31
public static void SaveAsCode(TextWriter writer, in
VBuffer
<float> weights, float bias,
37
var
featureNames = default(
VBuffer
<ReadOnlyMemory<char>>);
96
public static string LinearModelAsIni(in
VBuffer
<float> weights, float bias, IPredictor predictor = null,
105
var
featureNames = default(
VBuffer
<ReadOnlyMemory<char>>);
178
string userName, string loadName, string settings, in
VBuffer
<float> weights, float bias,
208
in
VBuffer
<Single> weights, in
VBuffer
<ReadOnlyMemory<char>> names)
229
in
VBuffer
<float> weights, float bias, RoleMappedSchema schema, List<KeyValuePair<string, object>> results)
231
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
Standard\LogisticRegression\LbfgsPredictorBase.cs (34)
159
private protected
VBuffer
<float> CurrentWeights;
186
private
VBuffer
<float>[] _features;
196
private
VBuffer
<float>[] _localGradients;
313
out
VBuffer
<float> init, out ITerminationCriterion terminationCriterion)
345
private protected virtual
VBuffer
<float> InitializeWeightsSgd(IChannel ch, FloatLabelCursor.Factory cursorFactory)
351
var
oldWeights = VBufferUtils.CreateEmpty<float>(BiasCount + WeightCount);
353
(in
VBuffer
<float> x) =>
371
VBuffer
<float> result = default(
VBuffer
<float>);
378
(in
VBuffer
<float> x, ref
VBuffer
<float> grad) =>
395
VBuffer
<float> sgdWeights;
417
private protected abstract
VBuffer
<float> InitializeWeightsFromPredictor(IPredictor srcPredictor);
421
private protected virtual void PreTrainingProcessInstance(float label, in
VBuffer
<float> feat, float weight)
585
_features = new
VBuffer
<float>[1000];
676
_localGradients = new
VBuffer
<float>[numThreads - 1];
691
VBuffer
<float> initWeights;
725
private protected void EnsureBiases(ref
VBuffer
<float> vec)
733
private protected abstract float AccumulateOneGradient(in
VBuffer
<float> feat, float label, float weight,
734
in
VBuffer
<float> xDense, ref
VBuffer
<float> grad, ref float[] scratch);
742
private protected virtual float DifferentiableFunction(in
VBuffer
<float> x, ref
VBuffer
<float> gradient,
753
VBuffer
<float> xDense = default;
758
VBuffer
<float> xDenseTemp = default;
802
private protected virtual float DifferentiableFunctionMultithreaded(in
VBuffer
<float> xDense, ref
VBuffer
<float> gradient, IProgressChannel pch)
814
var
xx = xDense;
815
var
gg = gradient;
834
private protected float DifferentiableFunctionComputeChunk(int ichk, in
VBuffer
<float> xDense, ref
VBuffer
<float> grad, IProgressChannel pch)
860
private protected float DifferentiableFunctionStream(FloatLabelCursor.Factory cursorFactory, in
VBuffer
<float> xDense, ref
VBuffer
<float> grad, IProgressChannel pch)
888
private protected
VBuffer
<float> InitializeWeights(IEnumerable<float> weights, IEnumerable<float> biases)
Standard\LogisticRegression\LogisticRegression.cs (12)
190
private protected override float AccumulateOneGradient(in
VBuffer
<float> feat, float label, float weight,
191
in
VBuffer
<float> x, ref
VBuffer
<float> grad, ref float[] scratch)
271
var
namesSpans = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(featureLength);
411
VBuffer
<float> weightsOnly = default(
VBuffer
<float>);
413
var
std = LbfgsTrainerOptions.ComputeStandardDeviation.ComputeStandardDeviation(hessian, weightIndices, numParams, CurrentWeights.Length, ch, L2Weight);
425
out
VBuffer
<float> init, out ITerminationCriterion terminationCriterion)
437
private protected override
VBuffer
<float> InitializeWeightsFromPredictor(IPredictor srcPredictor)
452
VBuffer
<float> weights = default(
VBuffer
<float>);
496
public abstract
VBuffer
<float> ComputeStandardDeviation(double[] hessian, int[] weightIndices, int parametersCount, int currentWeightsCount, IChannel ch, float l2Weight);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (44)
188
VBuffer
<ReadOnlyMemory<char>> labelNames = default;
233
out
VBuffer
<float> init, out ITerminationCriterion terminationCriterion)
244
private protected override float AccumulateOneGradient(in
VBuffer
<float> feat, float label, float weight,
245
in
VBuffer
<float> x, ref
VBuffer
<float> grad, ref float[] scores)
280
private protected override
VBuffer
<float> InitializeWeightsFromPredictor(IPredictor srcPredictor)
416
ModelParametersBase<
VBuffer
<float>>,
436
private protected readonly
VBuffer
<float>[] Weights;
445
private volatile
VBuffer
<float>[] _weightsDense;
456
internal LinearMulticlassModelParametersBase(IHostEnvironment env, string name, in
VBuffer
<float> weights, int numClasses, int numFeatures, string[] labelNames, ModelStatisticsBase stats = null)
472
Weights = new
VBuffer
<float>[NumberOfClasses];
500
internal LinearMulticlassModelParametersBase(IHostEnvironment env, string name,
VBuffer
<float>[] weights, float[] bias, int numClasses, int numFeatures, string[] labelNames, ModelStatisticsBase stats = null)
511
Weights = new
VBuffer
<float>[NumberOfClasses];
568
Weights = new
VBuffer
<float>[NumberOfClasses];
597
Weights = new
VBuffer
<float>[NumberOfClasses];
632
foreach (
var
fw in Weights)
662
foreach (
var
fv in Weights)
693
foreach (
var
fw in Weights)
721
foreach (
var
fw in Weights)
755
private static int NonZeroCount(in
VBuffer
<float> vector)
769
Host.Check(typeof(TSrc) == typeof(
VBuffer
<float>), "Invalid source type in GetMapper");
770
Host.Check(typeof(TDst) == typeof(
VBuffer
<float>), "Invalid destination type in GetMapper");
772
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del =
773
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
782
private void PredictCore(in
VBuffer
<float> src, ref
VBuffer
<float> dst)
797
private
VBuffer
<float>[] DensifyWeights()
805
var weightsDense = new
VBuffer
<float>[NumberOfClasses];
810
var
w = Weights[i];
826
/// In <see cref="PredictCore(in
VBuffer
{float}, ref
VBuffer
{float})"/> we compute the i-th class' score
838
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
1029
public void GetWeights(ref
VBuffer
<float>[] weights, out int numClasses)
1098
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames =
1099
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
1119
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
1148
internal LinearMulticlassModelParameters(IHostEnvironment env, in
VBuffer
<float> weights, int numClasses, int numFeatures, string[] labelNames, ModelStatisticsBase stats = null)
1153
internal LinearMulticlassModelParameters(IHostEnvironment env,
VBuffer
<float>[] weights, float[] bias, int numClasses, int numFeatures, string[] labelNames, ModelStatisticsBase stats = null)
1220
internal MaximumEntropyModelParameters(IHostEnvironment env, in
VBuffer
<float> weights, int numClasses, int numFeatures, string[] labelNames, ModelStatisticsBase stats = null)
1225
internal MaximumEntropyModelParameters(IHostEnvironment env,
VBuffer
<float>[] weights, float[] bias, int numClasses, int numFeatures, string[] labelNames, ModelStatisticsBase stats = null)
Standard\ModelStatistics.cs (29)
181
internal virtual DataViewSchema.Annotations MakeStatisticsMetadata(RoleMappedSchema schema, in
VBuffer
<ReadOnlyMemory<char>> names)
232
private readonly
VBuffer
<float> _coeffStdError;
237
private readonly
VBuffer
<float> _weights;
245
in
VBuffer
<float> coeffStdError,
VBuffer
<float> weights, float bias)
357
private void GetUnorderedCoefficientStatistics(in
VBuffer
<ReadOnlyMemory<char>> names,
358
ref
VBuffer
<float> estimate, ref
VBuffer
<float> stdErr, ref
VBuffer
<float> zScore, ref
VBuffer
<float> pValue, out ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames)
389
var
slotNames = names;
391
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
432
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
557
internal override DataViewSchema.Annotations MakeStatisticsMetadata(RoleMappedSchema schema, in
VBuffer
<ReadOnlyMemory<char>> names)
571
var
estimate = default(
VBuffer
<float>);
572
var
stdErr = default(
VBuffer
<float>);
573
var
zScore = default(
VBuffer
<float>);
574
var
pValue = default(
VBuffer
<float>);
575
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getSlotNames;
583
builder.Add("Estimate", colType, (ref
VBuffer
<float> dst) => estimate.CopyTo(ref dst), subMeta);
584
builder.Add("StandardError", colType, (ref
VBuffer
<float> dst) => stdErr.CopyTo(ref dst), subMeta);
585
builder.Add("ZScore", colType, (ref
VBuffer
<float> dst) => zScore.CopyTo(ref dst), subMeta);
586
builder.Add("PValue", colType, (ref
VBuffer
<float> dst) => pValue.CopyTo(ref dst), subMeta);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (7)
225
ModelParametersBase<
VBuffer
<float>>,
412
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
413
Host.Check(typeof(TOut) == typeof(
VBuffer
<float>));
415
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del = Map;
596
private void Map(in
VBuffer
<float> src, ref
VBuffer
<float> dst)
Standard\MulticlassClassification\OneVersusAllTrainer.cs (26)
245
ModelParametersBase<
VBuffer
<float>>,
450
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
451
Host.Check(typeof(TOut) == typeof(
VBuffer
<float>));
506
public abstract ValueMapper<
VBuffer
<float>,
VBuffer
<float>> GetMapper();
621
public override ValueMapper<
VBuffer
<float>,
VBuffer
<float>> GetMapper()
623
var maps = new ValueMapper<
VBuffer
<float>, float>[Predictors.Length];
625
maps[i] = Predictors[i].GetMapper<
VBuffer
<float>, float>();
629
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
635
var
tmp = src;
714
public override ValueMapper<
VBuffer
<float>,
VBuffer
<float>> GetMapper()
716
var maps = new ValueMapper<
VBuffer
<float>, float, float>[Predictors.Length];
718
maps[i] = _mappers[i].GetMapper<
VBuffer
<float>, float, float>();
722
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
728
var
tmp = src;
870
public override ValueMapper<
VBuffer
<float>,
VBuffer
<float>> GetMapper()
872
var maps = new ValueMapper<
VBuffer
<float>, float>[Predictors.Length];
874
maps[i] = Predictors[i].GetMapper<
VBuffer
<float>, float>();
878
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
884
var
tmp = src;
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (10)
228
ModelParametersBase<
VBuffer
<float>>,
460
Host.Check(typeof(TIn) == typeof(
VBuffer
<float>));
461
Host.Check(typeof(TOut) == typeof(
VBuffer
<float>));
463
var maps = new ValueMapper<
VBuffer
<float>, float, float>[_mappers.Length];
465
maps[i] = _mappers[i].GetMapper<
VBuffer
<float>, float, float>();
468
ValueMapper<
VBuffer
<float>,
VBuffer
<float>> del =
469
(in
VBuffer
<float> src, ref
VBuffer
<float> dst) =>
474
var
tmp = src;
Standard\Online\AveragedLinear.cs (4)
139
protected
VBuffer
<float> TotalWeights;
182
public float AveragedMargin(in
VBuffer
<float> feat)
188
public override float Margin(in
VBuffer
<float> feat)
220
public override void ProcessDataInstance(IChannel ch, in
VBuffer
<float> feat, float label, float weight)
Standard\Online\AveragedPerceptron.cs (1)
133
VBuffer
<float> weights = default;
Standard\Online\LinearSvm.cs (5)
127
private
VBuffer
<float> _weightsUpdate;
168
private void FinishBatch(in
VBuffer
<float> weightsUpdate, float weightsUpdateScale)
178
public override void ProcessDataInstance(IChannel ch, in
VBuffer
<float> feat, float label, float weight)
223
private void UpdateWeights(in
VBuffer
<float> weightsUpdate, float weightsUpdateScale)
257
public override float Margin(in
VBuffer
<float> feat)
Standard\Online\OnlineGradientDescent.cs (1)
110
VBuffer
<float> weights = default;
Standard\Online\OnlineLinear.cs (6)
95
/// The number of examples in the current iteration. Incremented by <see cref="ProcessDataInstance(IChannel, in
VBuffer
{float}, float, float)"/>,
109
public
VBuffer
<float> Weights;
227
public virtual void ProcessDataInstance(IChannel ch, in
VBuffer
<float> feat, float label, float weight)
236
public float CurrentMargin(in
VBuffer
<float> feat)
240
/// The default implementation just calls <see cref="CurrentMargin(in
VBuffer
{float})"/>.
244
public virtual float Margin(in
VBuffer
<float> feat)
Standard\PoissonRegression\PoissonRegression.cs (9)
137
private protected override
VBuffer
<float> InitializeWeightsFromPredictor(IPredictor srcPredictor)
143
private protected override void PreTrainingProcessInstance(float label, in
VBuffer
<float> feat, float weight)
151
private protected override float DifferentiableFunction(in
VBuffer
<float> x, ref
VBuffer
<float> gradient, IProgressChannelProvider progress)
166
private protected override float AccumulateOneGradient(in
VBuffer
<float> feat, float label, float weight,
167
in
VBuffer
<float> x, ref
VBuffer
<float> grad, ref float[] scratch)
191
VBuffer
<float> weights = default(
VBuffer
<float>);
Standard\SdcaBinary.cs (39)
130
private protected float WDot(in
VBuffer
<float> features, in
VBuffer
<float> weights, float bias)
135
private protected float WScaledDot(in
VBuffer
<float> features, Double scaling, in
VBuffer
<float> weights, float bias)
317
private protected float WDot(in
VBuffer
<float> features, in
VBuffer
<float> weights, float bias)
467
var weights = new
VBuffer
<float>[weightSetCount];
468
var bestWeights = new
VBuffer
<float>[weightSetCount];
469
var l1IntermediateWeights = l1ThresholdZero ? null : new
VBuffer
<float>[weightSetCount];
582
var
features = cursor.Features;
679
private protected abstract TModel CreatePredictor(
VBuffer
<float>[] weights, float[] bias);
792
VBuffer
<float>[] weights, float[] biasUnreg,
VBuffer
<float>[] l1IntermediateWeights, float[] l1IntermediateBias, float[] featureNormSquared)
816
VBuffer
<float> features = cursor.Features;
951
VBuffer
<float>[] weights,
952
VBuffer
<float>[] bestWeights,
969
VBuffer
<float> firstWeights = weights[0];
980
var
features = cursor.Features;
1525
private protected LinearBinaryModelParameters CreateLinearBinaryModelParameters(
VBuffer
<float>[] weights, float[] bias)
1531
VBuffer
<float> maybeSparseWeights = default;
1613
private protected override CalibratedModelParametersBase<LinearBinaryModelParameters, PlattCalibrator> CreatePredictor(
VBuffer
<float>[] weights, float[] bias)
1740
/// Comparing with <see cref="SdcaLogisticRegressionBinaryTrainer.CreatePredictor(
VBuffer
{float}[], float[])"/>,
1744
private protected override LinearBinaryModelParameters CreatePredictor(
VBuffer
<float>[] weights, float[] bias)
1813
private protected override IPredictorWithFeatureWeights<float> CreatePredictor(
VBuffer
<float>[] weights, float[] bias)
1819
VBuffer
<float> maybeSparseWeights = default;
2051
var
weights = default(
VBuffer
<float>);
2084
var
features = cursor.Features;
2123
VBuffer
<float> features = cursor.Features;
2204
/// <see cref="CreateModel(
VBuffer
{float}, float)"/> implements a mechanism to craft a typed model out from linear weights and a bias.
2206
/// Derived classes should implement <see cref="CreateModel(
VBuffer
{float}, float)"/> because different trainers may produce different
2212
private protected abstract TModel CreateModel(
VBuffer
<float> weights, float bias);
2215
/// A helper function used to create <see cref="LinearBinaryModelParameters"/> in implementations of <see cref="CreateModel(
VBuffer
{float}, float)"/>.
2217
private protected LinearBinaryModelParameters CreateLinearBinaryModelParameters(
VBuffer
<float> weights, float bias)
2221
VBuffer
<float> maybeSparseWeights = default;
2311
/// <see cref="CreateModel(
VBuffer
{float}, float)"/> produces the final calibrated linear model.
2313
private protected override CalibratedModelParametersBase<LinearBinaryModelParameters, PlattCalibrator> CreateModel(
VBuffer
<float> weights, float bias)
2397
private protected override LinearBinaryModelParameters CreateModel(
VBuffer
<float> weights, float bias)
2452
private protected override IPredictorWithFeatureWeights<float> CreateModel(
VBuffer
<float> weights, float bias)
Standard\SdcaMulticlass.cs (7)
176
VBuffer
<float>[] weights, float[] biasUnreg,
VBuffer
<float>[] l1IntermediateWeights, float[] l1IntermediateBias, float[] featureNormSquared)
346
VBuffer
<float>[] weights,
347
VBuffer
<float>[] bestWeights,
381
var
features = cursor.Features;
554
private protected override MaximumEntropyModelParameters CreatePredictor(
VBuffer
<float>[] weights, float[] bias)
651
private protected override LinearMulticlassModelParameters CreatePredictor(
VBuffer
<float>[] weights, float[] bias)
Standard\SdcaRegression.cs (2)
144
private protected override LinearRegressionModelParameters CreatePredictor(
VBuffer
<float>[] weights, float[] bias)
150
VBuffer
<float> maybeSparseWeights = default;
Standard\Simple\SimpleTrainers.cs (12)
126
Contracts.Check(typeof(TIn) == typeof(
VBuffer
<float>));
129
ValueMapper<
VBuffer
<float>, float> del = Map;
135
Contracts.Check(typeof(TIn) == typeof(
VBuffer
<float>));
139
ValueMapper<
VBuffer
<float>, float, float> del = MapDist;
155
private void Map(in
VBuffer
<float> src, ref float dst)
160
private void MapDist(in
VBuffer
<float> src, ref float score, ref float prob)
447
Contracts.Check(typeof(TIn) == typeof(
VBuffer
<float>));
450
ValueMapper<
VBuffer
<float>, float> del = Map;
456
Contracts.Check(typeof(TIn) == typeof(
VBuffer
<float>));
460
ValueMapper<
VBuffer
<float>, float, float> del = MapDist;
464
private void Map(in
VBuffer
<float> src, ref float dst)
469
private void MapDist(in
VBuffer
<float> src, ref float score, ref float prob)
Microsoft.ML.Sweeper (1)
Algorithms\SmacSweeper.cs (1)
344
VBuffer
<float> features = new VBuffer<float>(transformedParams.Length, transformedParams);
Microsoft.ML.TensorFlow (9)
TensorflowTransform.cs (7)
718
ValueGetter<
VBuffer
<T>> valuegetter = (ref
VBuffer
<T> dst) =>
733
ValueGetter<
VBuffer
<T>> valuegetter = (ref
VBuffer
<T> dst) =>
866
private readonly ValueGetter<
VBuffer
<T>> _srcgetter;
868
private
VBuffer
<T> _vBuffer;
877
_srcgetter = input.GetGetter<
VBuffer
<T>>(input.Schema[colIndex]);
TensorflowUtils.cs (2)
68
VBuffer
<ReadOnlyMemory<char>> upstreamOperatorNames = default;
76
(ref
VBuffer
<ReadOnlyMemory<char>> value) => { upstreamOperatorNames.CopyTo(ref value); });
Microsoft.ML.TensorFlow.Tests (74)
TensorFlowEstimatorTests.cs (12)
174
var
buffer = default(
VBuffer
<float>);
175
var getter = cursor.GetGetter<
VBuffer
<float>>(result.Schema["Output"]);
267
var
buffer = default(
VBuffer
<float>);
268
var getter = cursor.GetGetter<
VBuffer
<float>>(result.Schema["Output"]);
299
VBuffer
<float> avalue = default;
300
VBuffer
<float> bvalue = default;
301
VBuffer
<float> cvalue = default;
303
var aGetter = cursor.GetGetter<
VBuffer
<float>>(result.Schema["a"]);
304
var bGetter = cursor.GetGetter<
VBuffer
<float>>(result.Schema["b"]);
305
var cGetter = cursor.GetGetter<
VBuffer
<float>>(result.Schema["c"]);
TensorflowTests.cs (62)
205
var cgetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[2]);
207
VBuffer
<float> c = default;
298
var oneDimgetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[outColIndex]);
299
var twoDimgetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[outColIndex + 1]);
300
var threeDimgetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[outColIndex + 2]);
301
var fourDimgetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[outColIndex + 3]);
302
var fourDimKnowngetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[outColIndex + 4]);
304
VBuffer
<float> oneDim = default;
305
VBuffer
<float> twoDim = default;
306
VBuffer
<float> threeDim = default;
307
VBuffer
<float> fourDim = default;
308
VBuffer
<float> fourDimKnown = default;
419
var f64getter = cursor.GetGetter<
VBuffer
<double>>(cursor.Schema[11]);
420
var f32getter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[12]);
421
var i64getter = cursor.GetGetter<
VBuffer
<long>>(cursor.Schema[13]);
422
var i32getter = cursor.GetGetter<
VBuffer
<int>>(cursor.Schema[14]);
423
var i16getter = cursor.GetGetter<
VBuffer
<short>>(cursor.Schema[15]);
424
var i8getter = cursor.GetGetter<
VBuffer
<sbyte>>(cursor.Schema[16]);
425
var u64getter = cursor.GetGetter<
VBuffer
<ulong>>(cursor.Schema[17]);
426
var u32getter = cursor.GetGetter<
VBuffer
<uint>>(cursor.Schema[18]);
427
var u16getter = cursor.GetGetter<
VBuffer
<ushort>>(cursor.Schema[19]);
428
var u8getter = cursor.GetGetter<
VBuffer
<byte>>(cursor.Schema[20]);
429
var boolgetter = cursor.GetGetter<
VBuffer
<bool>>(cursor.Schema[21]);
432
VBuffer
<double> f64 = default;
433
VBuffer
<float> f32 = default;
434
VBuffer
<long> i64 = default;
435
VBuffer
<int> i32 = default;
436
VBuffer
<short> i16 = default;
437
VBuffer
<sbyte> i8 = default;
438
VBuffer
<ulong> u64 = default;
439
VBuffer
<uint> u32 = default;
440
VBuffer
<ushort> u16 = default;
441
VBuffer
<byte> u8 = default;
442
VBuffer
<bool> b = default;
515
var getInput = curs.GetGetter<
VBuffer
<byte>>(tf.Schema["image_tensor"]);
516
var getBoxes = curs.GetGetter<
VBuffer
<float>>(tf.Schema["detection_boxes"]);
517
var getScores = curs.GetGetter<
VBuffer
<float>>(tf.Schema["detection_scores"]);
518
var getNum = curs.GetGetter<
VBuffer
<float>>(tf.Schema["num_detections"]);
519
var getClasses = curs.GetGetter<
VBuffer
<float>>(tf.Schema["detection_classes"]);
520
var
buffer = default(
VBuffer
<float>);
521
var
inputBuffer = default(
VBuffer
<byte>);
563
var get = curs.GetGetter<
VBuffer
<float>>(tf.Schema["softmax2_pre_activation"]);
564
var getInput = curs.GetGetter<
VBuffer
<float>>(tf.Schema["input"]);
565
var
buffer = default(
VBuffer
<float>);
566
var
inputBuffer = default(
VBuffer
<float>);
605
VBuffer
<ReadOnlyMemory<char>> inputOps = default;
742
var getter = cursor.GetGetter<
VBuffer
<float>>(trainDataTransformed.Schema["b"]);
745
var
trainedBias = default(
VBuffer
<float>);
1034
var
buffer = default(
VBuffer
<float>);
1035
var
buffer2 = default(
VBuffer
<float>);
1037
cursor.GetGetter<
VBuffer
<float>>(idv.Schema["Output"]);
1039
cursor2.GetGetter<
VBuffer
<float>>(idv.Schema["Output"]);
1084
var
buffer = default(
VBuffer
<float>);
1085
var getter = cursor.GetGetter<
VBuffer
<float>>(idv.Schema["Output"]);
Microsoft.ML.TestFramework (65)
BaseTestBaseline.cs (7)
736
VBuffer
<T> expectedVector = default;
739
ValueGetter<
VBuffer
<T>> expectedVectorGetter = default;
742
ValueGetter<
VBuffer
<T>> actualVectorGetter = default;
744
VBuffer
<T> actualVector = default;
750
expectedVectorGetter = expectedCursor.GetGetter<
VBuffer
<T>>(leftColumn);
751
actualVectorGetter = actualCursor.GetGetter<
VBuffer
<T>>(rightColumn);
759
actualVectorGetter = actualCursor.GetGetter<
VBuffer
<T>>(rightColumn);
DataPipe\TestDataPipe.cs (41)
27
private static
VBuffer
<Single> _dataFloatSparse = new VBuffer<Single>(5, 3, new float[] { -0.0f, 0, 1 }, new[] { 0, 3, 4 });
34
private static
VBuffer
<Double> _dataDoubleSparse = new VBuffer<Double>(5, 3, new double[] { -0.0, 0, 1 }, new[] { 0, 3, 4 });
219
var getters = new ValueGetter<
VBuffer
<float>>[cols.Length];
225
getters[i] = c.GetGetter<
VBuffer
<float>>(col.Value);
229
var
v1 = default(
VBuffer
<float>);
230
var
v2 = default(
VBuffer
<float>);
585
var get1 = c.GetGetter<
VBuffer
<float>>(col1.Value);
586
var get2 = c.GetGetter<
VBuffer
<float>>(col2.Value);
587
VBuffer
<float> bag1 = default;
588
VBuffer
<float> bag2 = default;
627
var get1 = c.GetGetter<
VBuffer
<float>>(col1.Value);
628
var get2 = c.GetGetter<
VBuffer
<float>>(col2.Value);
629
VBuffer
<float> bag1 = default;
630
VBuffer
<float> bag2 = default;
772
var
b1 = default(
VBuffer
<float>);
773
var
b2 = default(
VBuffer
<float>);
781
var get1 = c.GetGetter<
VBuffer
<float>>(col1.Value);
782
var get2 = c.GetGetter<
VBuffer
<float>>(col2.Value);
913
VBuffer
<ReadOnlyMemory<char>>[] expected = new
VBuffer
<ReadOnlyMemory<char>>[2];
924
var getter = c.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(col.Value);
925
var
buffer = default(
VBuffer
<ReadOnlyMemory<char>>);
1137
private void TestHashTransformVectorHelper<T>(
VBuffer
<T> data, uint[][] results, NumberDataViewType type)
1150
var resultGetter = cursor.GetGetter<
VBuffer
<uint>>(cursor.Schema[1]);
1151
VBuffer
<uint> resultRow = new VBuffer<uint>();
1211
var del2 = cursor.GetGetter<
VBuffer
<int>>(cursor.Schema[1]);
1214
VBuffer
<int> value2 = default(
VBuffer
<int>);
1511
var getter = cursor.GetGetter<
VBuffer
<float>>(loader.Schema["DT"]);
1512
var getter1 = cursor.GetGetter<
VBuffer
<float>>(loader.Schema["DT1"]);
1513
VBuffer
<float> buffer = default;
1514
VBuffer
<float> buffer1 = default;
1557
var resultGetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[1]);
1558
VBuffer
<float> resultFirstRow = new VBuffer<float>();
1559
VBuffer
<float> resultSecondRow = new VBuffer<float>();
1560
VBuffer
<float> resultThirdRow = new VBuffer<float>();
DataPipe\TestDataPipeBase.cs (12)
1019
var g1 = r1.GetGetter<
VBuffer
<T>>(r1.Schema[col]);
1020
var g2 = r2.GetGetter<
VBuffer
<T>>(r2.Schema[col]);
1021
var
v1 = default(
VBuffer
<T>);
1022
var
v2 = default(
VBuffer
<T>);
1044
protected void VerifyVecEquality<T>(ValueGetter<
VBuffer
<T>> vecGetter, ValueGetter<
VBuffer
<T>> vecNGetter, Func<int, T, T, bool> compare, int size)
1046
VBuffer
<T> fv = default(
VBuffer
<T>);
1047
VBuffer
<T> fvn = default(
VBuffer
<T>);
TestSparseDataView.cs (5)
29
public
VBuffer
<T> X;
52
var
value = new VBuffer<T>();
56
var getter = cur.GetGetter<
VBuffer
<T>>(cur.Schema[0]);
92
var
value = new VBuffer<T>();
96
var getter = cur.GetGetter<
VBuffer
<T>>(cur.Schema[0]);
Microsoft.ML.TestFrameworkCommon (9)
TestCommon.cs (9)
131
public static bool CompareVec<T>(in
VBuffer
<T> v1, in
VBuffer
<T> v2, int size, Func<T, T, bool> fn)
136
public static bool CompareVec<T>(in
VBuffer
<T> v1, in
VBuffer
<T> v2, int size, Func<int, T, T, bool> fn)
234
var
names1 = default(
VBuffer
<ReadOnlyMemory<char>>);
235
var
names2 = default(
VBuffer
<ReadOnlyMemory<char>>);
269
private static bool CheckMetadataCallFailure(string kind, DataViewSchema sch, int col, ref
VBuffer
<ReadOnlyMemory<char>> names)
Microsoft.ML.Tests (123)
FeatureContributionTests.cs (3)
265
VBuffer
<float>[] vbArray = new
VBuffer
<float>[numberOfInstances];
274
VBuffer
<float> vb;
OnnxConversionTest.cs (2)
1521
VBuffer
<ReadOnlyMemory<char>> mlNetSlots = default;
1522
VBuffer
<ReadOnlyMemory<char>> onnxSlots = default;
PermutationFeatureImportanceTests.cs (3)
889
VBuffer
<float>[] vbArray = new
VBuffer
<float>[numberOfInstances];
898
VBuffer
<float> vb;
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (2)
245
VBuffer
<float>[] weights = default;
434
var
weights = new VBuffer<float>();
Scenarios\Api\Estimators\PredictAndMetadata.cs (2)
46
VBuffer
<ReadOnlyMemory<char>> originalLabels = default;
60
VBuffer
<ReadOnlyMemory<char>> keys = default;
Scenarios\Api\TestApi.cs (5)
216
var
valueVBuffer = new VBuffer<float>(4, new float[] { 4, 6, 89, 5 });
250
VBuffer
<ReadOnlyMemory<char>> retrievedReadOnlyMemoryVBuffer = new VBuffer<ReadOnlyMemory<char>>();
254
VBuffer
<float> retrievedFloatVBuffer = new VBuffer<float>(1, new float[] { 2 });
256
VBuffer
<float> valueFloatVBuffer = new VBuffer<float>(valueFloatArray.Length, valueFloatArray);
259
VBuffer
<float> retrievedVBuffer = new VBuffer<float>();
Scenarios\GetColumnTests.cs (2)
38
var enum3 = data.GetColumn<
VBuffer
<float>>(data.Schema["floatVector"]).ToArray();
80
var enum3 = data.GetColumn<
VBuffer
<float>>("floatVector").ToArray();
SvmLightTests.cs (13)
30
public
VBuffer
<float> Features;
241
var featuresGetter = curs.GetGetter<
VBuffer
<float>>(view.Schema["Features"]);
242
VBuffer
<float> buffer = default;
328
var getter = curs.GetGetter<
VBuffer
<float>>(data.Schema["Features"]);
329
VBuffer
<float> features = default;
354
var getter = curs.GetGetter<
VBuffer
<float>>(data.Schema["Features"]);
355
VBuffer
<float> features = default;
373
var getter = curs.GetGetter<
VBuffer
<float>>(data.Schema["Features"]);
374
VBuffer
<float> features = default;
392
var getter = curs.GetGetter<
VBuffer
<float>>(data.Schema["Features"]);
393
VBuffer
<float> features = default;
423
var getter = curs.GetGetter<
VBuffer
<float>>(data.Schema["Features"]);
424
VBuffer
<float> features = default;
TermEstimatorTests.cs (2)
145
var
names1 = default(
VBuffer
<ReadOnlyMemory<char>>);
TextLoaderTests.cs (24)
775
var
featureValue = (
VBuffer
<float>)previewIrisStartEnd.RowView[0].Values[0].Value;
796
featureValue = (
VBuffer
<float>)previewIrisColumnIndices.RowView[0].Values[0].Value;
910
VBuffer
<T> featuresPeriod = default;
911
ValueGetter<
VBuffer
<T>> featuresDelegatePeriod = cursorPeriod.GetGetter<
VBuffer
<T>>(columnsPeriod[1]);
960
VBuffer
<T> featuresComma = default;
961
ValueGetter<
VBuffer
<T>> featuresDelegateComma = cursorComma.GetGetter<
VBuffer
<T>>(columnsComma[1]);
1013
VBuffer
<Single> featuresPeriod = default;
1014
ValueGetter<
VBuffer
<Single>> featuresDelegatePeriod = cursor.GetGetter<
VBuffer
<Single>>(columns[1]);
1075
VBuffer
<Single> featuresPeriod = default;
1076
VBuffer
<Single> featuresComma = default;
1082
var delegatePeriod = cursorPeriod.GetGetter<
VBuffer
<Single>>(dataViewPeriod.Schema["Features"]);
1083
var delegateComma = cursorComma.GetGetter<
VBuffer
<Single>>(dataViewPeriod.Schema["Features"]);
1487
VBuffer
<Single> testSingFt1 = default;
1488
VBuffer
<Single> testSingFt2 = default;
1493
VBuffer
<Double> testDoubFt1 = default;
1494
VBuffer
<Double> testDoubFt2 = default;
1518
var delegateTestSingFt1 = cursorTest.GetGetter<
VBuffer
<Single>>(testDV.Schema["singFt1"]);
1519
var delegateTestSingFt2 = cursorTest.GetGetter<
VBuffer
<Single>>(testDV.Schema["singFt2"]);
1524
var delegateTestDoubFt1 = cursorTest.GetGetter<
VBuffer
<Double>>(testDV.Schema["doubFt1"]);
1525
var delegateTestDoubFt2 = cursorTest.GetGetter<
VBuffer
<Double>>(testDV.Schema["doubFt2"]);
TrainerEstimators\TreeEnsembleFeaturizerTest.cs (3)
67
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
90
VBuffer
<ReadOnlyMemory<char>> leafIdsSlotNames = default;
113
VBuffer
<ReadOnlyMemory<char>> pathIdsSlotNames = default;
Transformers\CategoricalHashTests.cs (2)
139
VBuffer
<ReadOnlyMemory<char>> slots = default;
140
VBuffer
<int> slotRanges = default;
Transformers\CategoricalTests.cs (3)
142
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
217
VBuffer
<ReadOnlyMemory<char>> slots = default;
218
VBuffer
<int> slotRanges = default;
Transformers\ConvertTests.cs (2)
295
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
353
VBuffer
<ReadOnlyMemory<char>> slots = default;
Transformers\CopyColumnEstimatorTests.cs (4)
145
var
names1 = default(
VBuffer
<ReadOnlyMemory<char>>);
146
var
names2 = default(
VBuffer
<ReadOnlyMemory<char>>);
Transformers\CountTargetEncodingTests.cs (8)
132
var getters = new ValueGetter<
VBuffer
<float>>[countCols.Length];
133
var getters1 = new ValueGetter<
VBuffer
<float>>[countCols.Length];
136
getters[i] = curs.GetGetter<
VBuffer
<float>>(transformedData.Schema[countCols[i]]);
137
getters1[i] = curs1.GetGetter<
VBuffer
<float>>(transformedData1.Schema[countCols[i]]);
140
var
buffer = default(
VBuffer
<float>);
141
var
buffer1 = default(
VBuffer
<float>);
Transformers\HashTests.cs (11)
85
VBuffer
<ReadOnlyMemory<char>> keys = default;
164
var
denseVec = new VBuffer<T>(vecLen, Utils.CreateArray(vecLen, val));
166
builder.Add("Foo", new VectorDataViewType(type, vecLen), (ref
VBuffer
<T> dst) => denseVec.CopyTo(ref dst));
170
var vecGetter = hashGetter<
VBuffer
<uint>>(info);
171
VBuffer
<uint> vecResult = default;
180
vecGetter = hashGetter<
VBuffer
<uint>>(info);
195
var
sparseVec = new VBuffer<T>(10, 3, Utils.CreateArray(3, val), new[] { 0, 3, 7 });
197
builder.Add("Foo", new VectorDataViewType(type, vecLen), (ref
VBuffer
<T> dst) => sparseVec.CopyTo(ref dst));
201
vecGetter = hashGetter<
VBuffer
<uint>>(info);
210
vecGetter = hashGetter<
VBuffer
<uint>>(info);
397
var dHashed = transformed.GetColumn<
VBuffer
<uint>>(transformed.Schema["DHashed"]).Select(buffer =>
Transformers\KeyToBinaryVectorEstimatorTest.cs (1)
114
VBuffer
<ReadOnlyMemory<char>> slots = default;
Transformers\KeyToVectorEstimatorTests.cs (2)
132
VBuffer
<ReadOnlyMemory<char>> slots = default;
133
VBuffer
<int> slotRanges = default;
Transformers\NAIndicatorTests.cs (1)
145
var
value = new VBuffer<ReadOnlyMemory<char>>();
Transformers\TextFeaturizerTests.cs (6)
109
VBuffer
<float> features = default;
122
var featureGetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema["Features"]);
151
VBuffer
<float> features = default;
164
var featureGetter = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema["Features"]);
578
VBuffer
<ReadOnlyMemory<char>> text = default;
579
var getter = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(cursor.Schema["Text"]);
Transformers\ValueMappingTests.cs (18)
116
var getterVecD = cursor.GetGetter<
VBuffer
<int>>(result.Schema["VecD"]);
121
VBuffer
<int> dValue = default;
151
var getterVecD = cursor.GetGetter<
VBuffer
<uint>>(result.Schema["VecD"]);
156
VBuffer
<uint> dValue = default;
200
var getterD = cursor.GetGetter<
VBuffer
<int>>(result.Schema["D"]);
201
var getterE = cursor.GetGetter<
VBuffer
<int>>(result.Schema["E"]);
202
var getterF = cursor.GetGetter<
VBuffer
<int>>(result.Schema["F"]);
206
VBuffer
<int> dValue = default;
209
VBuffer
<int> eValue = default;
212
VBuffer
<int> fValue = default;
283
var getterD = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(result.Schema[3]);
284
var getterE = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(result.Schema[4]);
285
var getterF = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(result.Schema[5]);
288
VBuffer
<ReadOnlyMemory<char>> dValue = default;
292
VBuffer
<ReadOnlyMemory<char>> eValue = default;
296
VBuffer
<ReadOnlyMemory<char>> fValue = default;
574
var allowedKeyValueGetter = annotations.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(annotations.Schema["KeyValues"]);
575
VBuffer
<ReadOnlyMemory<char>> allowedKeys = default;
Transformers\WordBagTransformerTests.cs (4)
48
Assert.Equal(expected, ((
VBuffer
<float>)pred.ColumnView[4].Values[0]).DenseValues().ToArray());
76
Assert.Equal(expected, ((
VBuffer
<float>)pred.ColumnView[4].Values[0]).DenseValues().ToArray());
116
Assert.Equal(((
VBuffer
<float>)predDefault.ColumnView[4].Values[0]).DenseValues().ToArray(), ((
VBuffer
<float>)predNonDefault.ColumnView[4].Values[0]).DenseValues().ToArray());
Microsoft.ML.TimeSeries (47)
AdaptiveSingularSpectrumSequenceModeler.cs (3)
57
public
VBuffer
<Single> ForecastStandardDeviation;
58
public
VBuffer
<Single> UpperBound;
59
public
VBuffer
<Single> LowerBound;
SequenceModelerBase.cs (1)
16
public
VBuffer
<T> PointForecast;
SequentialAnomalyDetectionTransformBase.cs (9)
126
internal abstract class SequentialAnomalyDetectionTransformBase<TInput, TState> : SequentialTransformerBase<TInput,
VBuffer
<Double>, TState>
306
private readonly
VBuffer
<ReadOnlyMemory<Char>> _slotNames;
340
public void GetSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> dst) => _slotNames.CopyTo(ref dst, 0, _parent.OutputLength);
362
private delegate void ProcessData(ref TInput src, ref
VBuffer
<double> dst);
371
ValueGetter<
VBuffer
<double>> valueGetter = (ref
VBuffer
<double> dst) =>
423
internal abstract class AnomalyDetectionStateBase : SequentialTransformerBase<TInput,
VBuffer
<Double>, TState>.StateBase
511
private protected override void SetNaOutput(ref
VBuffer
<Double> dst)
522
public sealed override void TransformCore(ref TInput input, FixedSizeQueue<TInput> windowedBuffer, long iteration, ref
VBuffer
<Double> dst)
SequentialForecastingTransformBase.cs (12)
52
internal abstract class SequentialForecastingTransformBase<TInput, TState> : SequentialTransformerBase<TInput,
VBuffer
<float>, TState>
163
ValueGetter<
VBuffer
<float>> valueGetter = (ref
VBuffer
<float> dst) =>
175
ValueGetter<
VBuffer
<float>> valueGetter = (ref
VBuffer
<float> dst) =>
185
ValueGetter<
VBuffer
<float>> valueGetter = (ref
VBuffer
<float> dst) =>
196
private delegate void ProcessData(ref TInput src, ref
VBuffer
<float> dst);
205
ValueGetter<
VBuffer
<float>> valueGetter = (ref
VBuffer
<float> dst) =>
272
internal abstract class ForecastingStateBase : SequentialTransformerBase<TInput,
VBuffer
<float>, TState>.StateBase
295
private protected override void SetNaOutput(ref
VBuffer
<float> dst)
SlidingWindowTransformBase.cs (3)
21
internal abstract class SlidingWindowTransformBase<TInput> : SequentialTransformBase<TInput,
VBuffer
<TInput>, SlidingWindowTransformBase<TInput>.StateSlide>
131
private protected override void SetNaOutput(ref
VBuffer
<TInput> output)
154
private protected override void TransformCore(ref TInput input, FixedSizeQueue<TInput> windowedBuffer, long iteration, ref
VBuffer
<TInput> output)
SrCnnEntireAnomalyDetector.cs (3)
337
public ValueGetter<
VBuffer
<double>> CreateGetter(DataViewRowCursor input, string inputCol)
340
ValueGetter<
VBuffer
<double>> getter =
341
(ref
VBuffer
<double> dst) =>
SrCnnTransformBase.cs (9)
54
internal abstract class SrCnnTransformBase<TInput, TState> : SequentialTransformerBase<TInput,
VBuffer
<Double>, TState>
149
private readonly
VBuffer
<ReadOnlyMemory<Char>> _slotNames;
183
public void GetSlotNames(ref
VBuffer
<ReadOnlyMemory<char>> dst) => _slotNames.CopyTo(ref dst, 0, _parent.OutputLength);
205
private delegate void ProcessData(ref TInput src, ref
VBuffer
<double> dst);
214
ValueGetter<
VBuffer
<double>> valueGetter = (ref
VBuffer
<double> dst) =>
263
internal abstract class SrCnnStateBase : SequentialTransformerBase<TInput,
VBuffer
<Double>, TState>.StateBase
284
private protected override void SetNaOutput(ref
VBuffer
<double> dst)
295
public sealed override void TransformCore(ref TInput input, FixedSizeQueue<TInput> windowedBuffer, long iteration, ref
VBuffer
<double> dst)
SsaForecastingBase.cs (7)
259
public override void TransformCore(ref float input, FixedSizeQueue<float> windowedBuffer, long iteration, ref
VBuffer
<float> dst)
271
ref
VBuffer
<float> dst1, ref
VBuffer
<float> dst2, ref
VBuffer
<float> dst3)
286
public override void Forecast(ref
VBuffer
<float> dst)
292
public override void ConfidenceIntervalLowerBound(ref
VBuffer
<float> dst)
301
public override void ConfidenceIntervalUpperBound(ref
VBuffer
<float> dst)
Microsoft.ML.TorchSharp (90)
AutoFormerV2\ObjectDetectionMetrics.cs (12)
84
var labelColEnumerable = dataView.GetColumn<
VBuffer
<ReadOnlyMemory<char>>>(labelCol);
87
foreach (
var
labelRow in labelColEnumerable)
302
var predLabGet = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(predictedLabelCol);
303
var scoreGet = cursor.GetGetter<
VBuffer
<float>>(scoreCol);
304
var boxGet = cursor.GetGetter<
VBuffer
<float>>(predictedBoundingBoxColumn);
306
VBuffer
<ReadOnlyMemory<char>> predLab = default;
307
VBuffer
<float> score = default;
308
VBuffer
<float> box = default;
347
var predLabGet = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(labelCol);
348
var boxGet = cursor.GetGetter<
VBuffer
<float>>(actualBoundingBoxColumn);
350
VBuffer
<ReadOnlyMemory<char>> predLab = default;
351
VBuffer
<float> box = default;
AutoFormerV2\ObjectDetectionTrainer.cs (26)
245
var labelCol = input.GetColumn<
VBuffer
<uint>>(Parent.Option.LabelColumnName);
249
foreach (
var
label in labelCol)
290
var boundingBoxGetter = cursor.GetGetter<
VBuffer
<float>>(input.Schema[Parent.Option.BoundingBoxColumnName]);
292
var labelGetter = cursor.GetGetter<
VBuffer
<uint>>(input.Schema[Parent.Option.LabelColumnName]);
321
ValueGetter<
VBuffer
<float>> boundingBoxGetter,
323
ValueGetter<
VBuffer
<uint>> labelGetter,
364
private (Tensor image, Tensor Label) PrepareData(ValueGetter<
VBuffer
<uint>> labelGetter, ValueGetter<MLImage> imageGetter, ValueGetter<
VBuffer
<float>> boundingBoxGetter)
390
VBuffer
<uint> labels = default;
393
VBuffer
<float> boxes = default;
636
ValueGetter<
VBuffer
<T>> getter = LabelColumn.Annotations.GetGetter<
VBuffer
<T>>(LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
637
var
val = default(
VBuffer
<T>);
643
if (!saver.TryWriteTypeAndValue<
VBuffer
<T>>(ctx.Writer.BaseStream, labelColType, ref val, out bytesWritten))
716
VBuffer
<T> buffValue = (
VBuffer
<T>)value;
717
ValueGetter<
VBuffer
<T>> buffGetter = (ref
VBuffer
<T> dst) => buffValue.CopyTo(ref dst);
778
return labelCol.Annotations.GetGetter<
VBuffer
<T>>(labelCol.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
812
ValueGetter<
VBuffer
<float>> score = (ref
VBuffer
<float> dst) =>
836
ValueGetter<
VBuffer
<UInt32>> predictedLabel = (ref
VBuffer
<UInt32> dst) =>
860
ValueGetter<
VBuffer
<float>> score = (ref
VBuffer
<float> dst) =>
NasBert\NasBertTrainer.cs (1)
563
return labelCol.Annotations.GetGetter<
VBuffer
<T>>(labelCol.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
NasBert\NerTrainer.cs (35)
32
using TargetType =
VBuffer
<long>;
63
public class NerTrainer : NasBertTrainer<
VBuffer
<uint>,
TargetType
>
104
private protected override TrainerBase CreateTrainer(TorchSharpBaseTrainer<
VBuffer
<uint>,
TargetType
> parent, IChannel ch, IDataView input)
109
private protected override TorchSharpBaseTransformer<
VBuffer
<uint>,
TargetType
> CreateTransformer(IHost host, Options options, torch.nn.Module model, DataViewSchema.DetachedColumn labelColumn)
121
public Trainer(TorchSharpBaseTrainer<
VBuffer
<uint>,
TargetType
> parent, IChannel ch, IDataView input) : base(parent, ch, input, ModelUrlString)
126
private protected override
TargetType
AddToTargets(
VBuffer
<uint> target)
131
VBuffer
<long> t = new VBuffer<long>(target.Length + 1, tl.ToArray());
136
private protected override torch.Tensor CreateTargetsTensor(ref List<
TargetType
> targets, torch.Device device)
164
private protected override torch.Tensor PrepareRowTensor(ref
VBuffer
<uint> target)
215
VBuffer
<ReadOnlyMemory<char>> keys = default;
217
var labelCol = input.GetColumn<
VBuffer
<uint>>(Parent.Option.LabelColumnName);
220
foreach (
var
label in labelCol)
236
public sealed class NerTransformer : NasBertTransformer<
VBuffer
<uint>,
TargetType
>
262
private protected override IRowMapper GetRowMapper(TorchSharpBaseTransformer<
VBuffer
<uint>,
TargetType
> parent, DataViewSchema schema)
287
ValueGetter<
VBuffer
<T>> getter = LabelColumn.Annotations.GetGetter<
VBuffer
<T>>(LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
288
var
val = default(
VBuffer
<T>);
294
if (!saver.TryWriteTypeAndValue<
VBuffer
<T>>(ctx.Writer.BaseStream, labelColType, ref val, out bytesWritten))
359
VBuffer
<T> buffValue = (
VBuffer
<T>)value;
360
ValueGetter<
VBuffer
<T>> buffGetter = (ref
VBuffer
<T> dst) => buffValue.CopyTo(ref dst);
366
public Mapper(TorchSharpBaseTransformer<
VBuffer
<uint>,
TargetType
> parent, DataViewSchema inputSchema) : base(parent, inputSchema)
377
private void CondenseOutput(ref
VBuffer
<UInt32> dst, string sentence, Tokenizer tokenizer, TensorCacher outputCacher)
424
ValueGetter<
VBuffer
<UInt32>> classification = (ref
VBuffer
<UInt32> dst) =>
NasBert\TextClassificationTrainer.cs (11)
223
ValueGetter<
VBuffer
<T>> getter = LabelColumn.Annotations.GetGetter<
VBuffer
<T>>(LabelColumn.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
224
var
val = default(
VBuffer
<T>);
230
if (!saver.TryWriteTypeAndValue<
VBuffer
<T>>(ctx.Writer.BaseStream, labelColType, ref val, out bytesWritten))
295
VBuffer
<T> buffValue = (
VBuffer
<T>)value;
296
ValueGetter<
VBuffer
<T>> buffGetter = (ref
VBuffer
<T> dst) => buffValue.CopyTo(ref dst);
329
ValueGetter<
VBuffer
<float>> score = (ref
VBuffer
<float> dst) =>
Roberta\QATrainer.cs (4)
784
ValueGetter<
VBuffer
<float>> score = (ref
VBuffer
<float> dst) =>
811
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> predictedAnswer = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
TorchSharpBaseTrainer.cs (1)
452
return labelCol.Annotations.GetGetter<
VBuffer
<T>>(labelCol.Annotations.Schema[AnnotationUtils.Kinds.KeyValues]);
Microsoft.ML.TorchSharp.Tests (16)
NerTests.cs (12)
89
var labelGetter = cursor.GetGetter<
VBuffer
<uint>>(output.Schema[2]);
90
var predictedLabelGetter = cursor.GetGetter<
VBuffer
<uint>>(output.Schema[3]);
92
VBuffer
<uint> labelData = default;
93
VBuffer
<uint> predictedLabelData = default;
168
var labelGetter = cursor.GetGetter<
VBuffer
<uint>>(output.Schema[2]);
169
var predictedLabelGetter = cursor.GetGetter<
VBuffer
<uint>>(output.Schema[3]);
171
VBuffer
<uint> labelData = default;
172
VBuffer
<uint> predictedLabelData = default;
238
var labelGetter = cursor.GetGetter<
VBuffer
<uint>>(output.Schema[2]);
239
var predictedLabelGetter = cursor.GetGetter<
VBuffer
<uint>>(output.Schema[3]);
241
VBuffer
<uint> labelData = default;
242
VBuffer
<uint> predictedLabelData = default;
QATests.cs (4)
93
var answerGetter = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(transformedData.Schema["Answer"]);
97
var scoreGetter = cursor.GetGetter<
VBuffer
<float>>(transformedData.Schema["Score"]);
99
VBuffer
<ReadOnlyMemory<char>> answer = default;
103
VBuffer
<float> score = default;
Microsoft.ML.Transforms (350)
CountFeatureSelection.cs (5)
373
return new CountAggregator<T>(colType, row.GetGetter<
VBuffer
<T>>(row.Schema[colSrc]));
382
private sealed class CountAggregator<T> : CountAggregator, IColumnAggregator<
VBuffer
<T>>
388
private
VBuffer
<T> _buffer;
407
public CountAggregator(VectorDataViewType type, ValueGetter<
VBuffer
<T>> getter)
429
public void ProcessValue(in
VBuffer
<T> value)
Dracula\CountTableTransformer.cs (17)
186
var vectorGetters = new ValueGetter<
VBuffer
<uint>>[colCount];
190
vectorGetters[i] = cursor.GetGetter<
VBuffer
<uint>>(cols[i]);
198
var
srcBuffer = default(
VBuffer
<uint>);
279
private void IncrementVec(MultiCountTableBuilderBase builder, int iCol, ref
VBuffer
<uint> srcBuffer, uint labelKey)
314
VBuffer
<ReadOnlyMemory<char>> keyNames = default;
633
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> GetSlotNamesGetter(DataViewSchema.Column inputCol, int iinfo)
637
VBuffer
<ReadOnlyMemory<char>> inputSlotNames = default;
648
VBuffer
<ReadOnlyMemory<char>> featureNames = default;
649
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter =
650
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
680
private ValueGetter<
VBuffer
<float>> ConstructSingleGetter(DataViewRow input, int iinfo)
688
return (ref
VBuffer
<float> dst) =>
697
private ValueGetter<
VBuffer
<float>> ConstructVectorGetter(DataViewRow input, int iinfo)
702
VBuffer
<uint> src = default;
705
var srcGetter = input.GetGetter<
VBuffer
<uint>>(inputCol);
707
return (ref
VBuffer
<float> dst) =>
Dracula\Featurizer.cs (1)
118
public void GetFeatureNames(string[] classNames, ref
VBuffer
<ReadOnlyMemory<char>> featureNames)
ExpressionTransformer.cs (27)
568
Func<IExceptionContext, DataViewRow, DataViewSchema.Column[], int[], Delegate, DataViewType, ValueGetter<
VBuffer
<int>>> d;
601
private ValueGetter<
VBuffer
<TDst>> GetGetterVec<T0, TDst>(IExceptionContext ectx, DataViewRow input, DataViewSchema.Column[] inputColumns, int[] perm, Delegate del, DataViewType outputColumnItemType)
608
var getSrc0 = input.GetGetter<
VBuffer
<T0>>(inputColumns[0]);
609
var
src0 = default(
VBuffer
<T0>);
617
(ref
VBuffer
<TDst> dst) =>
635
(ref
VBuffer
<TDst> dst) =>
666
private ValueGetter<
VBuffer
<TDst>> GetGetterVec<T0, T1, TDst>(IExceptionContext ectx, DataViewRow input, DataViewSchema.Column[] inputColumns, int[] perm, Delegate del, DataViewType outputColumnItemType)
673
var getSrc0 = input.GetGetter<
VBuffer
<T0>>(inputColumns[perm[0]]);
675
var
src0 = default(
VBuffer
<T0>);
679
(ref
VBuffer
<TDst> dst) =>
726
private ValueGetter<
VBuffer
<TDst>> GetGetterVec<T0, T1, T2, TDst>(IExceptionContext ectx, DataViewRow input, DataViewSchema.Column[] inputColumns, int[] perm, Delegate del, DataViewType outputColumnItemType)
733
var getSrc0 = input.GetGetter<
VBuffer
<T0>>(inputColumns[perm[0]]);
736
var
src0 = default(
VBuffer
<T0>);
741
(ref
VBuffer
<TDst> dst) =>
789
private ValueGetter<
VBuffer
<TDst>> GetGetterVec<T0, T1, T2, T3, TDst>(IExceptionContext ectx, DataViewRow input, DataViewSchema.Column[] inputColumns, int[] perm, Delegate del, DataViewType outputColumnItemType)
796
var getSrc0 = input.GetGetter<
VBuffer
<T0>>(inputColumns[perm[0]]);
800
var
src0 = default(
VBuffer
<T0>);
806
(ref
VBuffer
<TDst> dst) =>
855
private ValueGetter<
VBuffer
<TDst>> GetGetterVec<T0, T1, T2, T3, T4, TDst>(IExceptionContext ectx, DataViewRow input, DataViewSchema.Column[] inputColumns, int[] perm, Delegate del, DataViewType outputColumnItemType)
862
var getSrc0 = input.GetGetter<
VBuffer
<T0>>(inputColumns[perm[0]]);
867
var
src0 = default(
VBuffer
<T0>);
874
(ref
VBuffer
<TDst> dst) =>
FourierDistributionSampler.cs (6)
52
internal abstract float Distance(in
VBuffer
<float> first, in
VBuffer
<float> second);
112
internal override float Distance(in
VBuffer
<float> first, in
VBuffer
<float> second)
233
internal override float Distance(in
VBuffer
<float> first, in
VBuffer
<float> second)
GcnTransform.cs (14)
370
var getSrc = input.GetGetter<
VBuffer
<float>>(input.Schema[_srcCols[iinfo]]);
371
var
src = default(
VBuffer
<float>);
372
ValueGetter<
VBuffer
<float>> del;
381
(ref
VBuffer
<float> dst) =>
392
(ref
VBuffer
<float> dst) =>
403
(ref
VBuffer
<float> dst) =>
414
(ref
VBuffer
<float> dst) =>
433
(ref
VBuffer
<float> dst) =>
442
(ref
VBuffer
<float> dst) =>
451
(ref
VBuffer
<float> dst) =>
460
(ref
VBuffer
<float> dst) =>
473
private static void FillValues(IExceptionContext ectx, in
VBuffer
<float> src, ref
VBuffer
<float> dst, float divisor, float scale, float offset = 0)
GroupTransform.cs (3)
471
_getter = (ValueGetter<
VBuffer
<TValue>>)Getter;
474
private void Getter(ref
VBuffer
<TValue> dst)
483
ctx.Check(typeof(T) == typeof(
VBuffer
<TValue>));
HashJoiningTransform.cs (15)
402
bldr.AddGetter<
VBuffer
<ReadOnlyMemory<char>>>(AnnotationUtils.Kinds.SlotNames,
409
private void GetSlotNames(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
420
VBuffer
<ReadOnlyMemory<char>> srcSlotNames = default;
526
private ValueGetter<
VBuffer
<uint>> ComposeGetterVecToVec<TSrc>(DataViewRow input, int iinfo)
532
var getSrc = GetSrcGetter<
VBuffer
<TSrc>>(input, iinfo);
534
var
src = default(
VBuffer
<TSrc>);
542
var
denseSource = default(
VBuffer
<TSrc>);
544
(ref
VBuffer
<uint> dst) =>
583
var getSrc = GetSrcGetter<
VBuffer
<TSrc>>(input, iinfo);
585
var
src = default(
VBuffer
<TSrc>);
590
var
denseSource = default(
VBuffer
<TSrc>);
KeyToVectorMapping.cs (15)
239
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
258
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
268
private void GenerateBitSlotName(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
279
private void GetSlotNames(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
290
var
namesSlotSrc = default(
VBuffer
<ReadOnlyMemory<char>>);
311
VBuffer
<ReadOnlyMemory<char>> bits = default;
351
private ValueGetter<
VBuffer
<float>> MakeGetterOne(DataViewRow input, int iinfo)
367
(ref
VBuffer
<float> dst) =>
381
private ValueGetter<
VBuffer
<float>> MakeGetterInd(DataViewRow input, int iinfo, VectorDataViewType typeSrc)
392
var
src = default(
VBuffer
<uint>);
396
(ref
VBuffer
<float> dst) =>
LearnerFeatureSelection.cs (5)
95
var
scores = default(
VBuffer
<Single>);
115
private static SlotsDroppingTransformer.ColumnOptions CreateDropSlotsColumn(Options options, in
VBuffer
<Single> scores, out int selectedCount)
266
private static void TrainCore(IHost host, IDataView input, Options options, ref
VBuffer
<Single> scores)
306
public static void Train(IHostEnvironment env, IDataView input, Options options, ref
VBuffer
<Single> scores)
MissingValueDroppingTransformer.cs (10)
226
private ValueGetter<
VBuffer
<TDst>> MakeVecGetter<TDst>(DataViewRow input, int iinfo)
228
var srcGetter = input.GetGetter<
VBuffer
<TDst>>(input.Schema[_srcCols[iinfo]]);
229
var
buffer = default(
VBuffer
<TDst>);
236
(ref
VBuffer
<TDst> value) =>
246
(ref
VBuffer
<TDst> value) =>
253
private void DropNAsAndDefaults<TDst>(ref
VBuffer
<TDst> src, ref
VBuffer
<TDst> dst, InPredicate<TDst> isNA)
297
private void DropNAs<TDst>(ref
VBuffer
<TDst> src, ref
VBuffer
<TDst> dst, InPredicate<TDst> isNA)
MissingValueIndicatorTransform.cs (10)
161
bldr.AddGetter<
VBuffer
<ReadOnlyMemory<char>>>(AnnotationUtils.Kinds.SlotNames,
175
private void GetSlotNames(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
203
var
names = default(
VBuffer
<ReadOnlyMemory<char>>);
244
ValueGetter<
VBuffer
<float>> del;
247
var getSrc = GetSrcGetter<
VBuffer
<float>>(input, iinfo);
249
(ref
VBuffer
<float> dst) =>
259
(ref
VBuffer
<float> dst) =>
270
private static void FillValues(float input, ref
VBuffer
<float> result)
294
private static void FillValues(IExceptionContext ectx, ref
VBuffer
<float> buffer)
MissingValueIndicatorTransformer.cs (11)
152
private static readonly FuncInstanceMethodInfo1<Mapper, DataViewRow, int, ValueGetter<
VBuffer
<bool>>> _composeGetterVecMethodInfo
153
= FuncInstanceMethodInfo1<Mapper, DataViewRow, int, ValueGetter<
VBuffer
<bool>>>.Create(target => target.ComposeGetterVec<int>);
271
private ValueGetter<
VBuffer
<bool>> ComposeGetterVec(DataViewRow input, int iinfo)
274
private ValueGetter<
VBuffer
<bool>> ComposeGetterVec<T>(DataViewRow input, int iinfo)
276
var getSrc = input.GetGetter<
VBuffer
<T>>(input.Schema[ColMapNewToOld[iinfo]]);
280
var
src = default(
VBuffer
<T>);
283
ValueGetter<
VBuffer
<bool>> getter;
286
(ref
VBuffer
<bool> dst) =>
299
private void FindNAs<T>(in
VBuffer
<T> src, InPredicate<T> isNA, bool defaultIsNA, List<int> indices, out bool sense)
344
private void FillValues(int srcLength, ref
VBuffer
<bool> dst, List<int> indices, bool sense)
MissingValueReplacing.cs (14)
242
Func<
VBuffer
<int>, VectorDataViewType, int, int[]> func = GetValuesArray<int>;
253
private T[] GetValuesArray<T>(
VBuffer
<T> src, VectorDataViewType srcType, int iinfo)
479
private
VBuffer
<T> CreateVBuffer<T>(T[] array)
511
Func<int[],
VBuffer
<int>> function = CreateVBuffer<int>;
670
var getSrc = input.GetGetter<
VBuffer
<T>>(input.Schema[ColMapNewToOld[iinfo]]);
674
var
src = default(
VBuffer
<T>);
675
ValueGetter<
VBuffer
<T>> getter;
684
(ref
VBuffer
<T> dst) =>
697
(ref
VBuffer
<T> dst) =>
708
private void FillValues<T>(in
VBuffer
<T> src, ref
VBuffer
<T> dst, InPredicate<T> isNA, T rep, bool repIsDefault)
778
private void FillValues<T>(in
VBuffer
<T> src, ref
VBuffer
<T> dst, InPredicate<T> isNA, T[] rep, BitArray repIsDefault)
MissingValueReplacingUtils.cs (4)
203
private abstract class StatAggregatorAcrossSlots<TItem, TStat> : StatAggregator<
VBuffer
<TItem>, TStat>
218
protected sealed override void ProcessRow(in
VBuffer
<TItem> src)
232
private abstract class StatAggregatorBySlot<TItem, TStatItem> : StatAggregator<
VBuffer
<TItem>, TStatItem[]>
242
protected sealed override void ProcessRow(in
VBuffer
<TItem> src)
MutualInformationFeatureSelection.cs (52)
418
private
VBuffer
<int> _labels; // always dense
425
private ValueMapper<
VBuffer
<bool>,
VBuffer
<int>> _boolMapper;
519
var
labels = default(
VBuffer
<int>);
523
var
tmp = default(
VBuffer
<int>);
530
var
tmp = default(
VBuffer
<Single>);
537
var
tmp = default(
VBuffer
<Double>);
544
var
tmp = default(
VBuffer
<bool>);
558
_labels = (
VBuffer
<int>)methodInfo.Invoke(this, parameters);
577
private delegate
VBuffer
<int> KeyLabelGetter<T>(Transposer trans, int labelCol, DataViewType labeColumnType);
579
private
VBuffer
<int> GetKeyLabels<T>(Transposer trans, int labelCol, DataViewType labelColumnType)
581
var
tmp = default(
VBuffer
<T>);
582
var
labels = default(
VBuffer
<int>);
600
(ref
VBuffer
<int> src, ref
VBuffer
<int> dst, out int min, out int lim) =>
608
(ref
VBuffer
<Single> src, ref
VBuffer
<int> dst, out int min, out int lim) =>
616
(ref
VBuffer
<Double> src, ref
VBuffer
<int> dst, out int min, out int lim) =>
624
(ref
VBuffer
<bool> src, ref
VBuffer
<int> dst, out int min, out int lim) =>
641
private delegate void Mapper<T>(ref
VBuffer
<T> src, ref
VBuffer
<int> dst, out int min, out int lim);
649
(ref
VBuffer
<T> src, ref
VBuffer
<int> dst, out int min, out int lim) =>
665
VBuffer
<int> slotValues = default(
VBuffer
<int>);
671
VBuffer
<T> tmp = default(
VBuffer
<T>);
684
private float ComputeMutualInformation(in
VBuffer
<int> features, int numFeatures, int offset)
725
private void FillTable(in
VBuffer
<int> features, int offset, int numFeatures)
767
private static ValueMapper<
VBuffer
<T>,
VBuffer
<int>> BinKeys<T>(DataViewType colType)
795
private void BinInts(in
VBuffer
<int> input, ref
VBuffer
<int> output,
814
private void BinSingles(in
VBuffer
<Single> input, ref
VBuffer
<int> output,
840
private void BinDoubles(in
VBuffer
<Double> input, ref
VBuffer
<int> output,
862
private void BinBools(in
VBuffer
<bool> input, ref
VBuffer
<int> output)
879
private static ValueMapper<
VBuffer
<TSrc>,
VBuffer
<TDst>> CreateVectorMapper<TSrc, TDst>(ValueMapper<TSrc, TDst> map)
891
private static void MapVector<TSrc, TDst>(this ValueMapper<TSrc, TDst> map, in
VBuffer
<TSrc> input, ref
VBuffer
<TDst> output)
OptionalColumnTransform.cs (4)
424
return (ValueGetter<
VBuffer
<T>>)((ref
VBuffer
<T> value) =>
512
return (ValueGetter<
VBuffer
<T>>)((ref
VBuffer
<T> value) =>
PermutationFeatureImportance.cs (7)
42
VBuffer
<ReadOnlyMemory<char>> slotNames = default;
62
VBuffer
<float> weights = default;
145
var featuresGetter = cursor.GetGetter<
VBuffer
<float>>(featuresColumn);
146
var
featuresBuffer = default(
VBuffer
<float>);
251
private static ReadOnlyMemory<char> GetSlotName(
VBuffer
<ReadOnlyMemory<char>> slotNames, int index)
272
public
VBuffer
<float> Features;
PermutationFeatureImportanceExtensions.cs (1)
704
VBuffer
<ReadOnlyMemory<char>> nameBuffer = default;
RandomFourierFeaturizing.cs (17)
296
var reservoirSamplers = new ReservoirSamplerWithReplacement<
VBuffer
<float>>[columns.Length];
305
var get = cursor.GetGetter<
VBuffer
<float>>(cursor.Schema[srcCols[i]]);
306
reservoirSamplers[i] = new ReservoirSamplerWithReplacement<
VBuffer
<float>>(rng, reservoirSize, get);
312
ValueGetter<
VBuffer
<float>> get =
313
(ref
VBuffer
<float> dst) =>
318
reservoirSamplers[i] = new ReservoirSamplerWithReplacement<
VBuffer
<float>>(rng, reservoirSize, get);
336
VBuffer
<float>[] res;
512
private ValueGetter<
VBuffer
<float>> GetterFromVectorType(DataViewRow input, int iinfo)
514
var getSrc = input.GetGetter<
VBuffer
<float>>(input.Schema[_srcCols[iinfo]]);
515
var
src = default(
VBuffer
<float>);
521
(ref
VBuffer
<float> dst) =>
529
private ValueGetter<
VBuffer
<float>> GetterFromFloatType(DataViewRow input, int iinfo)
537
var
oneDimensionalVector = new VBuffer<float>(1, new float[] { 0 });
540
(ref
VBuffer
<float> dst) =>
548
private void TransformFeatures(in
VBuffer
<float> src, ref
VBuffer
<float> dst, TransformInfo transformInfo,
SvmLight\SvmLightLoader.cs (12)
274
public
VBuffer
<ReadOnlyMemory<char>> FeatureKeys;
275
public
VBuffer
<float> FeatureValues;
289
public
VBuffer
<uint> FeatureKeys;
326
/// that maps a vector of indices and a vector of values into a single <see cref="
VBuffer
{T}"/> of values.
330
public
VBuffer
<uint> FeatureKeys;
331
public
VBuffer
<float> FeatureValues;
336
public
VBuffer
<float> Features;
364
private void MapCore(ref
VBuffer
<uint> keys, ref
VBuffer
<float> values, Output output)
683
VBuffer
<ReadOnlyMemory<char>> result = default;
684
var getter = cursor.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(col.Value);
731
VBuffer
<ReadOnlyMemory<char>> keyValues = default;
SvmLight\SvmLightSaver.cs (2)
133
var featuresGetter = cursor.GetGetter<
VBuffer
<float>>(featureCol.Value);
136
VBuffer
<float> features = default;
Text\LdaTransform.cs (20)
222
var
mapping = _columnMappings[columnIndex];
336
internal ModelParameters GetLdaSummary(
VBuffer
<ReadOnlyMemory<char>> mapping)
415
public int FeedTrain(IExceptionContext ectx, in
VBuffer
<Double> input)
465
public void Output(in
VBuffer
<Double> src, ref
VBuffer
<float> dst, int numBurninIter, bool reset)
605
private ValueGetter<
VBuffer
<float>> GetTopic(DataViewRow input, int iinfo)
608
var
src = default(
VBuffer
<Double>);
613
(ref
VBuffer
<float> dst) =>
637
private readonly List<
VBuffer
<ReadOnlyMemory<char>>> _columnMappings;
660
List<
VBuffer
<ReadOnlyMemory<char>>> columnMappings,
694
List<
VBuffer
<ReadOnlyMemory<char>>> columnMappings;
822
private static List<
VBuffer
<ReadOnlyMemory<char>>> Train(IHostEnvironment env, IChannel ch, IDataView inputData, LdaState[] states, params LatentDirichletAllocationEstimator.ColumnOptions[] columns)
833
var columnMappings = new List<
VBuffer
<ReadOnlyMemory<char>>>();
849
VBuffer
<ReadOnlyMemory<char>> dst = default;
853
dst = default(
VBuffer
<ReadOnlyMemory<char>>);
865
var getters = new ValueGetter<
VBuffer
<Double>>[columns.Length];
872
VBuffer
<Double> src = default;
945
var getters = new ValueGetter<
VBuffer
<Double>>[columns.Length];
952
VBuffer
<double> src = default;
Text\NgramHashingTransformer.cs (15)
172
private readonly
VBuffer
<ReadOnlyMemory<char>>[] _slotNames;
238
var valueGetters = new ValueGetter<
VBuffer
<float>>[columnWithInvertHash.Count];
240
valueGetters[i] = del[i] as ValueGetter<
VBuffer
<float>>;
241
VBuffer
<float> value = default;
562
ValueGetter<
VBuffer
<uint>>[] getSrc = new ValueGetter<
VBuffer
<uint>>[srcCount];
565
var
src = default(
VBuffer
<uint>);
575
ValueGetter<
VBuffer
<float>> del =
576
(ref
VBuffer
<float> dst) =>
621
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
842
public
VBuffer
<ReadOnlyMemory<char>>[] SlotNamesMetadata(out VectorDataViewType[] types)
844
var values = new
VBuffer
<ReadOnlyMemory<char>>[_iinfoToCollector.Length];
850
var
vec = values[iinfo] = _iinfoToCollector[iinfo].GetMetadata();
Text\NgramTransform.cs (17)
224
var getters = new ValueGetter<
VBuffer
<uint>>[columns.Length];
225
var src = new
VBuffer
<uint>[columns.Length];
267
var buffers = new
VBuffer
<float>[columns.Length];
514
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter = (ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
524
private void GetSlotNames(int iinfo, int size, ref
VBuffer
<ReadOnlyMemory<char>> dst)
530
var
unigramNames = new VBuffer<ReadOnlyMemory<char>>();
632
private void ComposeNgramString(uint[] ngram, int count, StringBuilder sb, int keyCount, in
VBuffer
<ReadOnlyMemory<char>> terms)
677
var
src = default(
VBuffer
<uint>);
684
ValueGetter<
VBuffer
<float>> del;
690
(ref
VBuffer
<float> dst) =>
707
(ref
VBuffer
<float> dst) =>
723
(ref
VBuffer
<float> dst) =>
787
((vectorType.RawType == typeof(
VBuffer
<UInt32>)) || (vectorType.RawType == typeof(
VBuffer
<UInt64>)) ||
788
(vectorType.RawType == typeof(
VBuffer
<UInt16>))))
Text\NgramUtils.cs (2)
70
public bool AddNgrams(in
VBuffer
<uint> src, int icol, uint keyMax)
133
public void GetResult(ref
VBuffer
<float> dst)
Text\StopWordsRemovingTransformer.cs (10)
411
var getSrc = input.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(input.Schema[_colMapNewToOld[iinfo]]);
412
var
src = default(
VBuffer
<ReadOnlyMemory<char>>);
416
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> del =
417
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
1102
var getSrc = input.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(input.Schema[ColMapNewToOld[iinfo]]);
1103
var
src = default(
VBuffer
<ReadOnlyMemory<char>>);
1107
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> del =
1108
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Text\TextNormalizing.cs (5)
358
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> MakeGetterVec(DataViewRow input, int iinfo)
360
var getSrc = input.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(input.Schema[ColMapNewToOld[iinfo]]);
362
var
src = default(
VBuffer
<ReadOnlyMemory<char>>);
367
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
Text\TokenizingByCharacters.cs (13)
286
ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> getter =
287
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
297
private void GetKeyValues(int iinfo, ref
VBuffer
<ReadOnlyMemory<char>> dst)
475
private ValueGetter<
VBuffer
<ushort>> MakeGetterOne(DataViewRow input, int iinfo)
481
(ref
VBuffer
<ushort> dst) =>
504
private ValueGetter<
VBuffer
<ushort>> MakeGetterVec(DataViewRow input, int iinfo)
511
var getSrc = input.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(input.Schema[ColMapNewToOld[iinfo]]);
512
var
src = default(
VBuffer
<ReadOnlyMemory<char>>);
514
ValueGetter<
VBuffer
<ushort>> getterWithStartEndSep = (ref
VBuffer
<ushort> dst) =>
552
ValueGetter<
VBuffer
<ushort>> getterWithUnitSep = (ref
VBuffer
<ushort> dst) =>
Text\WordEmbeddingsExtractor.cs (5)
551
private ValueGetter<
VBuffer
<float>> GetGetterVec(DataViewRow input, int iinfo)
560
var srcGetter = input.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(column);
561
var
src = default(
VBuffer
<ReadOnlyMemory<char>>);
566
(ref
VBuffer
<float> dst) =>
Text\WordTokenizing.cs (7)
249
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> MakeGetterOne(DataViewRow input, int iinfo)
258
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
275
private ValueGetter<
VBuffer
<ReadOnlyMemory<char>>> MakeGetterVec(DataViewRow input, int iinfo)
281
var getSrc = input.GetGetter<
VBuffer
<ReadOnlyMemory<char>>>(input.Schema[ColMapNewToOld[iinfo]]);
282
var
src = default(
VBuffer
<ReadOnlyMemory<char>>);
287
(ref
VBuffer
<ReadOnlyMemory<char>> dst) =>
UngroupTransform.cs (4)
608
/// <typeparam name="TValue"> is the output column's content type, for example, <see cref="
VBuffer
{T}"/>.</typeparam>
629
var srcGetter = Input.GetGetter<
VBuffer
<T>>(Input.Schema[col]);
635
VBuffer
<T> row = default(
VBuffer
<T>);
Microsoft.ML.Vision (19)
DnnRetrainTransform.cs (7)
889
ValueGetter<
VBuffer
<T>> valuegetter = (ref
VBuffer
<T> dst) =>
904
ValueGetter<
VBuffer
<T>> valuegetter = (ref
VBuffer
<T> dst) =>
1053
private readonly ValueGetter<
VBuffer
<T>> _srcgetter;
1055
private
VBuffer
<T> _vBuffer;
1064
_srcgetter = input.GetGetter<
VBuffer
<T>>(input.Schema[colIndex]);
ImageClassificationTrainer.cs (12)
764
private static Tensor EncodeByteAsString(
VBuffer
<byte> buffer)
795
public Tensor ProcessImage(in
VBuffer
<byte> imageBuffer)
836
var imageGetter = cursor.GetGetter<
VBuffer
<byte>>(imageColumn);
838
VBuffer
<byte> image = default;
1349
public sealed class ImageClassificationModelParameters : ModelParametersBase<
VBuffer
<float>>, IValueMapper, IDisposable
1476
public void Score(in
VBuffer
<byte> image, Span<float> classProbabilities)
1491
Host.Check(typeof(TSrc) == typeof(
VBuffer
<byte>));
1492
Host.Check(typeof(TDst) == typeof(
VBuffer
<float>));
1495
ValueMapper<
VBuffer
<byte>,
VBuffer
<float>> del = (in
VBuffer
<byte> src, ref
VBuffer
<float> dst) =>