183 references to VBufferUtils
Microsoft.ML.AutoML (1)
DatasetDimensions\DatasetDimensionsUtil.cs (1)
58if (VBufferUtils.HasNaNs(value))
Microsoft.ML.Core (2)
Data\AnnotationUtils.cs (2)
305VBufferUtils.Resize(ref slotNames, vectorSize, 0); 393VBufferUtils.Densify(ref catIndices);
Microsoft.ML.Core.Tests (25)
UnitTests\TestVBuffer.cs (25)
37VBufferUtils.ApplyAt(ref buffer, 6, (int slot, ref float value) => { value = value + 1; }); 58VBufferUtils.Apply(ref dst, (int i, ref float v) => v *= c); 321/// A trivial inefficient implementation equivalent to <see cref="VBufferUtils.ApplyWith"/>. 323private static void NaiveApplyWith<T1, T2>(ref VBuffer<T1> a, ref VBuffer<T2> b, VBufferUtils.PairManipulator<T1, T2> manip) 352VBufferUtils.PairManipulator<float, float> manip = (int ind, float av, ref float bv) => bv = 2 * bv + av - ind; 361VBufferUtils.ApplyWith(in a, ref b, manip); 368/// A trivial inefficient implementation equivalent to <see cref="VBufferUtils.ApplyWithEitherDefined"/>. 370private static void NaiveApplyWithEither<T1, T2>(ref VBuffer<T1> a, ref VBuffer<T2> b, VBufferUtils.PairManipulator<T1, T2> manip) 395VBufferUtils.PairManipulator<float, float> manip = (int ind, float av, ref float bv) => bv = 2 * bv + av - ind; 405VBufferUtils.ApplyWithEitherDefined(in a, ref b, manip); 412/// A trivial inefficient implementation equivalent to <see cref="VBufferUtils.ForEachEitherDefined"/> 413/// if <paramref name="union"/> is true, or if false <see cref="VBufferUtils.ForEachBothDefined"/>. 446VBufferUtils.ForEachEitherDefined(in a, in b, vis); 448VBufferUtils.ForEachBothDefined(in a, in b, vis); 495VBufferUtils.ApplyIntoEitherDefined(in a, ref actualDst, func); 533VBufferUtils.ApplyInto(in a, in b, ref actualDst, func); 565VBufferUtils.PairManipulator<float, float> manip = 705VBufferUtils.SlotValueManipulator<float> manip = (int i, ref float value) => value += i; 714VBufferUtils.ApplyAt(ref a, slot, manip); 729VBufferUtils.SlotValueManipulator<float> manip = (int i, ref float value) => value += i; 755VBufferUtils.SlotValueManipulator<float> manip = (int i, ref float value) => value += i; 762VBufferUtils.Densify(ref b); 785VBufferUtils.SlotValueManipulator<float> manip = (int i, ref float value) => value += i; 793VBufferUtils.DensifyFirst(ref b, dense); 1077/// we see in <see cref="VectorUtils"/> and <see cref="VBufferUtils"/>, e.g., various
Microsoft.ML.Data (51)
Data\BufferBuilder.cs (1)
439VBufferUtils.Resize(ref buffer, _length, 0);
DataLoadSave\Text\TextLoaderParser.cs (1)
421VBufferUtils.Resize(ref dst, _size, 0);
DataView\Transposer.cs (1)
1201VBufferUtils.Resize(ref value, len, 0);
Deprecated\Vector\VBufferMathUtils.cs (9)
109VBufferUtils.Resize(ref dst, length, 0); 157VBufferUtils.ApplyWith(in src, ref dst, (int i, float v1, ref float v2) => v2 += v1); 185VBufferUtils.ApplyWith(in src, ref dst, (int i, float v1, ref float v2) => v2 += c * v1); 214VBufferUtils.ApplyWithCopy(in src, ref dst, ref res, (int i, float v1, float v2, ref float v3) => v3 = v2 + c * v1); 231VBufferUtils.ApplyInto(in a, in b, ref dst, (ind, v1, v2) => v1 + c * v2); 376/// <see cref="VBufferUtils.ApplyInto{TSrc1,TSrc2,TDst}"/> except perhaps more efficiently, 399VBufferUtils.Resize(ref dst, src.Length, 0); 403VBufferUtils.ApplyIntoEitherDefined(in src, ref dst, (i, v) => -v); 405VBufferUtils.ApplyIntoEitherDefined(in src, ref dst, (i, v) => c * v);
Deprecated\Vector\VectorUtils.cs (2)
170VBufferUtils.ApplyWithEitherDefined(in a, ref dst, (int ind, float v1, ref float v2) => { v2 *= v1; }); 372VBufferUtils.ForEachEitherDefined(in a, in b,
Evaluators\ClusteringEvaluator.cs (6)
332_clusterCentroids[i] = VBufferUtils.CreateEmpty<Single>(features.Value.Type.GetVectorSize()); 413_clusterCentroids[i] = VBufferUtils.CreateEmpty<Single>(features.Value.Type.GetVectorSize()); 435if (VBufferUtils.HasNaNs(in _scores) || VBufferUtils.HasNonFinite(in _scores)) 475if (VBufferUtils.HasNaNs(in _scores) || VBufferUtils.HasNonFinite(in _scores))
Evaluators\EvaluatorUtils.cs (1)
972VBufferUtils.ForEachEitherDefined(in currSlotNames, in firstDvSlotNames,
Evaluators\MulticlassClassificationEvaluator.cs (2)
447if (VBufferUtils.HasNaNs(in _scores) || VBufferUtils.HasNonFinite(in _scores))
Evaluators\MultiOutputRegressionEvaluator.cs (1)
325if (VBufferUtils.HasNaNs(in _score))
Evaluators\QuantileRegressionEvaluator.cs (11)
127TotalL1Loss = VBufferUtils.CreateDense<Double>(size); 128TotalL2Loss = VBufferUtils.CreateDense<Double>(size); 129TotalLoss = VBufferUtils.CreateDense<Double>(size); 206return VBufferUtils.CreateDense<Double>(_size); 235VBufferUtils.PairManipulator<float, Double> lossFn = 237VBufferUtils.ApplyWith(in score, ref loss, lossFn); 242return VBufferUtils.HasNaNs(in score); 390var l1 = VBufferUtils.CreateDense<Double>(_scoreSize); 427VBufferUtils.PairManipulator<Double, Double> sqr = 434VBufferUtils.Resize(ref dst, _scoreSize, 0); 435VBufferUtils.ApplyWith(in l1, ref dst, sqr);
Scorers\FeatureContributionCalculation.cs (1)
334_slotNames = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(featureSize);
Transforms\FeatureContributionCalculationTransformer.cs (1)
190_slotNames = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(_featureColumnType.Size);
Transforms\Hashing.cs (4)
1045VBufferUtils.Resize(ref dst, src.Length, 0); 1099VBufferUtils.Resize(ref dst, src.Length, 0); 1163VBufferUtils.Resize(ref dst, src.Length, 0); 1227VBufferUtils.Resize(ref dst, src.Length, 0);
Transforms\KeyToValue.cs (1)
262VBufferUtils.Densify(ref keyMetadata);
Transforms\KeyToVector.cs (2)
386namesSlotSrc = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(typeSrc.Size); 485VBufferUtils.Resize(ref dst, size, 0);
Transforms\NormalizeColumnDbl.cs (1)
2028return !VBufferUtils.HasNaNs(in colValuesBuffer);
Transforms\NormalizeColumnSng.cs (1)
2192return !VBufferUtils.HasNaNs(in colValuesBuffer);
Transforms\SlotsDroppingTransformer.cs (1)
777VBufferUtils.Resize(ref value, 1, 0);
Transforms\ValueToKeyMappingTransformerImpl.cs (3)
737VBufferUtils.Resize(ref dst, 0); 957VBufferUtils.Resize(ref dst, cval); 992VBufferUtils.Resize(ref dst, cval);
Utilities\SlotDropper.cs (1)
115VBufferUtils.Resize(ref dst, 1, 0);
Microsoft.ML.Ensemble (1)
OutputCombiners\MultiVoting.cs (1)
80VBufferUtils.Resize(ref dst, 0);
Microsoft.ML.FastTree (4)
FastTree.cs (1)
3242VBufferUtils.Resize(ref weights, numFeatures, 0);
GamModelParameters.cs (1)
641_featNames = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(len);
TreeEnsemble\InternalTreeEnsemble.cs (2)
449_names = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(featValueCount); 450_content = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(featValueCount);
Microsoft.ML.ImageAnalytics (1)
ImagePixelExtractor.cs (1)
344VBufferUtils.Resize(ref dst, size, 0);
Microsoft.ML.KMeansClustering (8)
KMeansPlusPlusTrainer.cs (8)
223centroids[i] = VBufferUtils.CreateDense<float>(dimensionality); 859VBufferUtils.Densify(ref clusters[clusterCount]); 895VBufferUtils.Densify(ref clusters[clusterCount]); 1061Centroids[j] = VBufferUtils.CreateDense<float>(dimensionality); 1069CachedSum[j] = VBufferUtils.CreateDense<float>(dimensionality); 1079VBufferUtils.Clear(ref Centroids[i]); 1091VBufferUtils.Clear(ref CachedSum[i]); 1415cachedSumCopy[i] = VBufferUtils.CreateDense<float>(dimensionality);
Microsoft.ML.Mkl.Components (3)
SymSgdClassificationTrainer.cs (3)
256VBufferUtils.CreateMaybeSparseCopy(in weights, ref maybeSparseWeights, 716VBufferUtils.Densify(ref weights); 720weights = VBufferUtils.CreateDense<float>(numFeatures);
Microsoft.ML.PCA (4)
PcaTrainer.cs (4)
226var mean = _ensureZeroMean ? VBufferUtils.CreateDense<float>(dimension) : VBufferUtils.CreateEmpty<float>(dimension); 501_mean = VBufferUtils.CreateEmpty<float>(_dimension); 581VBufferUtils.ForEachDefined(in _eigenVectors[i],
Microsoft.ML.StandardTrainers (58)
Optimizer\DifferentiableFunction.cs (1)
103VBufferUtils.Resize(ref tempGrad, 0, 0);
Optimizer\L1Optimizer.cs (10)
51VBufferUtils.Apply(ref initial, delegate (int ind, ref float initialVal) 106VBufferUtils.ForEachDefined(in input, 109VBufferUtils.ForEachDefined(in input, (ind, value) => res += Math.Abs(value)); 114VBufferUtils.ForEachDefined(in input, 117VBufferUtils.ForEachDefined(in input, (ind, value) => res += value); 132VBufferUtils.ApplyInto(in _x, in _grad, ref _steepestDescDir, 150VBufferUtils.ApplyInto(in _x, in _grad, ref _steepestDescDir, 170VBufferUtils.ApplyWith(in _x, ref _newX, 179VBufferUtils.Apply(ref _newX, delegate (int ind, ref float newXval) 214VBufferUtils.ApplyWith(in _steepestDescDir, ref _dir,
Optimizer\LineSearch.cs (1)
510VBuffer<float> grad = VBufferUtils.CreateEmpty<float>(2);
Optimizer\Optimizer.cs (6)
235return _keepDense ? VBufferUtils.CreateDense<float>(Dim) : VBufferUtils.CreateEmpty<float>(Dim); 295VBufferUtils.ApplyWithEitherDefined(in _steepestDescDir, ref _dir, 307VBufferUtils.ApplyInto(in _x, in _grad, ref _steepestDescDir, 407VBufferUtils.Apply(ref _newX, delegate (int ind, ref float newXval) 488VBufferUtils.Apply(ref _newX, delegate (int ind, ref float newXval)
Optimizer\SgdOptimizer.cs (4)
171VBuffer<float> grad = VBufferUtils.CreateEmpty<float>(dim); 172VBuffer<float> step = VBufferUtils.CreateEmpty<float>(dim); 176VBuffer<float> avg = VBufferUtils.CreateEmpty<float>(dim); 181VBufferUtils.Resize(ref step, step.Length, 0);
Standard\LinearModelParameters.cs (1)
198Weight = VBufferUtils.CreateEmpty<float>(len);
Standard\LinearPredictorUtils.cs (2)
43VBufferUtils.ForEachDefined(in weights, 110VBufferUtils.ForEachDefined(in weights,
Standard\LogisticRegression\LbfgsPredictorBase.cs (13)
337init = VBufferUtils.CreateEmpty<float>(BiasCount + WeightCount); 351var oldWeights = VBufferUtils.CreateEmpty<float>(BiasCount + WeightCount); 381VBufferUtils.Resize(ref grad, grad.Length, 0); 397sgdWeights = VBufferUtils.CreateDense<float>(BiasCount + WeightCount); 399sgdWeights = VBufferUtils.CreateEmpty<float>(BiasCount + WeightCount); 679_localGradients[i] = VBufferUtils.CreateEmpty<float>(size); 714VBufferUtils.ForEachDefined(in CurrentWeights, (index, value) => { if (index >= BiasCount && value != 0) numParams++; }); 730VBufferUtils.DensifyFirst(ref vec, BiasCount); 785VBufferUtils.ApplyWithEitherDefined(in x, ref gradient, 839VBufferUtils.Clear(ref grad); 840VBufferUtils.Densify(ref grad); 864VBufferUtils.Clear(ref grad); 865VBufferUtils.Densify(ref grad);
Standard\LogisticRegression\LogisticRegression.cs (2)
250VBufferUtils.ForEachDefined(in CurrentWeights, (ind, value) => { if (ind >= BiasCount) regLoss += Math.Abs(value); }); 271var namesSpans = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(featureLength);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (1)
336VBufferUtils.ForEachDefined(in CurrentWeights, (ind, value) => { if (ind >= BiasCount) regLoss += Math.Abs(value); });
Standard\Online\AveragedLinear.cs (2)
163VBufferUtils.Densify(ref Weights); 170VBufferUtils.Densify(ref Weights);
Standard\Online\LinearSvm.cs (3)
148VBufferUtils.Densify(ref Weights); 150_weightsUpdate = VBufferUtils.CreateEmpty<float>(numFeatures); 165VBufferUtils.Resize(ref _weightsUpdate, _weightsUpdate.Length, 0);
Standard\Online\OnlineLinear.cs (3)
141VBufferUtils.Densify(ref Weights); 170Weights = VBufferUtils.CreateDense<float>(numFeatures); 172Weights = VBufferUtils.CreateEmpty<float>(numFeatures);
Standard\SdcaBinary.cs (8)
478weights[i] = VBufferUtils.CreateDense<float>(numFeatures); 479bestWeights[i] = VBufferUtils.CreateDense<float>(numFeatures); 487l1IntermediateWeights[i] = VBufferUtils.CreateDense<float>(numFeatures); 1533VBufferUtils.CreateMaybeSparseCopy(weights[0], ref maybeSparseWeights, 1821VBufferUtils.CreateMaybeSparseCopy(weights[0], ref maybeSparseWeights, 2056VBufferUtils.Densify(ref weights); 2060weights = VBufferUtils.CreateDense<float>(numFeatures); 2222VBufferUtils.CreateMaybeSparseCopy(weights, ref maybeSparseWeights,
Standard\SdcaRegression.cs (1)
152VBufferUtils.CreateMaybeSparseCopy(weights[0], ref maybeSparseWeights,
Microsoft.ML.Transforms (25)
GcnTransform.cs (1)
482VBufferUtils.Resize(ref dst, length, 0);
KeyToVectorMapping.cs (1)
302namesSlotSrc = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(srcVectorSize);
MissingValueDroppingTransformer.cs (3)
268VBufferUtils.Resize(ref dst, 0); 278VBufferUtils.Resize(ref dst, newCount); 312VBufferUtils.Resize(ref dst, src.Length - srcValues.Length, 0);
MissingValueIndicatorTransform.cs (1)
274VBufferUtils.Resize(ref result, 2, 0);
MissingValueIndicatorTransformer.cs (1)
351VBufferUtils.Resize(ref dst, srcLength, 0);
MissingValueReplacing.cs (1)
257VBufferUtils.Densify<T>(ref src);
MutualInformationFeatureSelection.cs (2)
566VBufferUtils.Densify(ref labels); 585VBufferUtils.Densify(ref labels);
OptionalColumnTransform.cs (2)
425VBufferUtils.Resize(ref value, length, 0)); 513VBufferUtils.Resize(ref value, length, 0));
PermutationFeatureImportance.cs (2)
60slotNames = VBufferUtils.CreateEmpty<ReadOnlyMemory<char>>(numSlots); 205VBufferUtils.ApplyAt(ref dst.Features, workingIndx,
SvmLight\SvmLightLoader.cs (2)
369VBufferUtils.Densify(ref keys); 370VBufferUtils.Densify(ref values);
Text\LdaTransform.cs (1)
486VBufferUtils.Resize(ref dst, len, 0);
Text\NgramTransform.cs (5)
698VBufferUtils.Apply(ref dst, (int i, ref float v) => v = (float)(v * _parent._invDocFreqs[iinfo][i])); 701VBufferUtils.Resize(ref dst, 0); 715VBufferUtils.Apply(ref dst, (int i, ref float v) => v = v >= 1 ? (float)_parent._invDocFreqs[iinfo][i] : 0); 718VBufferUtils.Resize(ref dst, 0); 733VBufferUtils.Resize(ref dst, 0);
Text\StopWordsRemovingTransformer.cs (2)
438VBufferUtils.Copy(list, ref dst, list.Count); 1126VBufferUtils.Copy(list, ref dst, list.Count);
Text\TextNormalizing.cs (1)
379VBufferUtils.Copy(list, ref dst, list.Count);