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