243 references to IsDense
Microsoft.ML.Core (27)
Utilities\VBufferUtils.cs (27)
90if (a.IsDense) 120if (a.IsDense && b.IsDense) 125else if (b.IsDense) 131else if (a.IsDense) 171if (a.IsDense && b.IsDense) 176else if (b.IsDense) 186else if (a.IsDense) 275if (dst.IsDense) 310if (dst.IsDense) 356if (dst.IsDense) 404if (dst.IsDense || denseCount == 0 || (dstValues.Length >= denseCount && dstIndices[denseCount - 1] == denseCount - 1)) 451if (!src.IsDense || src.Length < 20) 629if (dst.IsDense) 642if (src.IsDense) 645if (!dst.IsDense) 658if (dst.IsDense) 892else if (src.IsDense) 917else if (dst.IsDense) 936else if (src.IsDense) 1011else if (src.IsDense) 1143if (src.IsDense) 1197if (a.IsDense || b.IsDense) 1201if (!a.IsDense) 1211else if (!b.IsDense)
Microsoft.ML.Core.Tests (17)
UnitTests\TestVBuffer.cs (17)
289Assert.False(a.IsDense); 313Assert.True(a.IsDense); 556if (aa.IsDense) 666if (c == 0 && !a.IsDense) 765Assert.True(b.IsDense, "Result was not dense, as expected"); 796Assert.True(b.IsDense || !a.IsDense, "Density of a did not imply density of b"); 910int logicalIndex = a.IsDense ? index : a.GetIndices()[index]; 930if (a.IsDense) 936expectedIndices.Count, expectedValues.ToArray(), a.IsDense ? null : expectedIndices.ToArray()); 1031Assert.Equal(expected.IsDense, actual.IsDense); 1032if (!expected.IsDense) 1180if (expected.IsDense && actual.IsDense) 1185else if (expected.IsDense) 1201else if (actual.IsDense)
Microsoft.ML.Data (87)
Data\BufferBuilder.cs (1)
402if (buffer.IsDense)
Data\Conversion.cs (4)
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\RowCursorUtils.cs (1)
288if (!src.IsDense)
DataLoadSave\Binary\Codecs.cs (1)
919if (value.IsDense)
DataLoadSave\Text\TextSaver.cs (2)
180if (_src.IsDense) 214int index = _slotNames.IsDense ? i : slotNamesIndices[i];
DataView\CacheDataView.cs (1)
1368if (!_temp.IsDense)
DataView\Transposer.cs (7)
572if (rbuff.IsDense) 610heap.Add(new KeyValuePair<int, int>(rbuff.IsDense ? 0 : rbuff.GetIndices()[0], r)); 625int ii = rbuff.IsDense ? s : _rbuffIndices[pair.Value]++; 626Ch.Assert(rbuff.IsDense || rbuffIndices[ii] == s); 630heap.Add(new KeyValuePair<int, int>(rbuff.IsDense ? s + 1 : rbuffIndices[ii], pair.Value)); 1188if (_inputValue.IsDense) 1230if (_inputValue.IsDense)
DataView\TypedCursor.cs (2)
459if (value.Length == Utils.Size(buf) && value.IsDense) 471if (value.IsDense)
Deprecated\Instances\HeaderSchema.cs (1)
167if (names.IsDense)
Deprecated\Vector\VBufferMathUtils.cs (14)
113if (src.IsDense) 147if (dst.IsDense) 150if (src.IsDense) 175if (dst.IsDense) 178if (src.IsDense) 206if (dst.IsDense && src.IsDense) 250if (dst.IsDense) 255if (src.IsDense) 273if (src.IsDense) 318if (src.IsDense) 389if (src.Length > 0 && src.IsDense) 420if (src.IsDense) 456if (src.IsDense)
Deprecated\Vector\VectorUtils.cs (17)
36if (b.IsDense) 50if (a.IsDense) 52if (b.IsDense) 57if (b.IsDense) 79bool isDense = a.IsDense; 164if (a.IsDense && dst.IsDense) 260if (a.IsDense) 262if (b.IsDense) 272if (b.IsDense) 312if (b.IsDense) 397if (a.IsDense) 399if (b.IsDense) 403if (b.IsDense) 418if (b.IsDense) 450if (src.IsDense) 478if (src.IsDense)
Evaluators\EvaluatorUtils.cs (3)
699if (src.IsDense) 1248Contracts.Assert(dst.IsDense); 1399host.Assert(labelNames.IsDense, "Slot names vector must be dense");
Evaluators\MultiOutputRegressionEvaluator.cs (2)
343if (!_label.IsDense) 351if (!_score.IsDense)
Evaluators\QuantileRegressionEvaluator.cs (5)
51Host.Assert(quantiles.IsDense && quantiles.Length == scoreSize); 146if (score.IsDense) 177if (loss.IsDense) 194Contracts.Assert(src.IsDense); 288if (!quantiles.IsDense)
Scorers\FeatureContributionCalculation.cs (1)
239var indices = contributions.IsDense ? Utils.GetIdentityPermutation(contributions.Length) : editor.Indices;
Transforms\ColumnConcatenatingTransformer.cs (1)
748if (buffer.IsDense)
Transforms\Hashing.cs (13)
1052if (!src.IsDense) 1065if (src.IsDense) 1106if (!src.IsDense) 1119if (src.IsDense) 1168if (src.IsDense) 1191if (src.IsDense) 1232if (src.IsDense) 1255if (src.IsDense) 1680Contracts.Assert(_value.IsDense == _hash.IsDense); 1725Contracts.Assert(_value.IsDense == _hash.IsDense); 1728if (_hash.IsDense)
Transforms\KeyToValue.cs (2)
319Parent.Host.Assert(values.IsDense); 393if (src.IsDense)
Transforms\KeyToVector.cs (1)
580if (src.IsDense)
Transforms\NormalizeColumn.cs (1)
933if (_buffer.IsDense)
Transforms\ValueToKeyMappingTransformerImpl.cs (6)
399if (_val.IsDense || _addedDefaultFromSparse) 416Contracts.Assert(!_val.IsDense && !_addedDefaultFromSparse); 789Contracts.Assert(src.IsDense); 971int slot = !src.IsDense ? indices[islot] : islot; 1002if (src.IsDense) 1154Contracts.Assert(tempMeta.IsDense);
Utilities\SlotDropper.cs (1)
125if (src.IsDense)
Microsoft.ML.DataView (13)
VBuffer.cs (13)
53/// Note that if this vector <see cref="IsDense"/>, then this will be the same as the <see cref="ReadOnlySpan{T}.Length"/> 61/// The explicitly represented values. When this <see cref="IsDense"/>, the <see cref="ReadOnlySpan{T}.Length"/> 80public ReadOnlySpan<int> GetIndices() => IsDense ? default : _indices.AsSpan(0, _count); 181if (!IsDense) 196if (IsDense) 203Debug.Assert(destination.IsDense); 228if (IsDense) 236Debug.Assert(destination.IsDense); 292if (IsDense) 361/// In the case where <see cref="IsDense"/> is <see langword="true"/>, this will take constant time since it an 378if (IsDense) 397if (IsDense) 405=> IsDense ? $"Dense vector of size {Length}" : $"Sparse vector of size {Length}, {_count} explicit values";
Microsoft.ML.Ensemble (1)
EnsembleUtils.cs (1)
54if (src.IsDense)
Microsoft.ML.EntryPoints (1)
FeatureCombiner.cs (1)
128if (!metadata.IsDense)
Microsoft.ML.FastTree (14)
BinFile\BinFinder.cs (4)
78if (!values.IsDense && valueBuffer[0] > 0) 96if (last < 0 && curr >= 0 && !values.IsDense) 121if (!values.IsDense && distinctValues[idist] < 0) 239int arraySize = values.IsDense ? valuesCount : valuesCount + 1;
FastTree.cs (5)
1210else if (!values.IsDense && zeroBin == 0 && valuesValues.Length < (1 - sparsifyThreshold) * values.Length) 1221if (!values.IsDense) 1314if (!src.IsDense) 1513int iindex = doubleTemp.IsDense ? index : doubleTempIndices[index]; 1593int ii = temp.IsDense ? i : tempIndices[i];
GamModelParameters.cs (2)
209if (features.IsDense) 240if (features.IsDense)
TreeEnsemble\InternalRegressionTree.cs (3)
783if (feat.IsDense) 799if (feat.IsDense) 817if (feat.IsDense)
Microsoft.ML.KMeansClustering (2)
KMeansModelParameters.cs (2)
187if (_centroids[i].IsDense) 246if (!_centroids[i].IsDense)
Microsoft.ML.Mkl.Components (4)
OlsLinearRegression.cs (3)
818Host.CheckDecode(Weight.IsDense); 914Contracts.Assert(Weight.IsDense); 929Contracts.Assert(Weight.IsDense);
VectorWhitening.cs (1)
688if (src.IsDense)
Microsoft.ML.PCA (3)
PcaTrainer.cs (3)
308bool center = mean.IsDense; 535if (_mean.IsDense) // centered 565if (_mean.IsDense)
Microsoft.ML.Predictor.Tests (1)
TestTransposer.cs (1)
48retval[(temp.IsDense ? i : tempIndices[i]) * rc + offset] = tempValues[i];
Microsoft.ML.StandardTrainers (37)
LdSvm\LdSvmModelParameters.cs (8)
62Host.Assert(w.All(v => v.IsDense)); 65Host.Assert(thetaPrime.All(v => v.IsDense)); 68Host.Assert(theta.All(v => v.IsDense)); 130Host.Assert(_w.All(v => v.IsDense)); 133Host.Assert(_thetaPrime.All(v => v.IsDense)); 136Host.Assert(_theta.All(v => v.IsDense)); 215Host.Assert(vector.IsDense); 238Host.Assert(result[i].IsDense);
Optimizer\SgdOptimizer.cs (4)
406if (x.IsDense && xprev.IsDense) 414else if (xprev.IsDense) 437else if (x.IsDense)
Standard\LinearModelParameters.cs (3)
130if (Weight.IsDense) 205if (Weight.IsDense) 266if (src.IsDense)
Standard\LogisticRegression\LbfgsPredictorBase.cs (2)
754if (x.IsDense) 774Contracts.Assert(xDense.IsDense);
Standard\LogisticRegression\LogisticRegression.cs (2)
214Contracts.Assert(editor.Values.Length >= BiasCount && (grad.IsDense || editor.Indices[BiasCount - 1] == BiasCount - 1)); 229Contracts.Assert(CurrentWeights.IsDense);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (9)
196if (!labelNames.IsDense) 272Contracts.Assert(editor.Values.Length >= BiasCount && (grad.IsDense || editor.Indices[BiasCount - 1] == BiasCount - 1)); 317Contracts.Assert(CurrentWeights.IsDense); 475if (Weights.All(v => v.IsDense)) 520if (Weights.All(v => v.IsDense)) 696if (fw.IsDense) 724if (fw.IsDense) 786if (!src.IsDense) 811if (w.IsDense)
Standard\ModelStatistics.cs (6)
323if (!_coeffStdError.IsDense) 330ctx.Writer.WriteBoolByte(_weights.IsDense); 333if (!_weights.IsDense) 371bool denseStdError = _coeffStdError.IsDense; 414bool denseStdError = _coeffStdError.IsDense; 437bool denseStdError = _coeffStdError.IsDense;
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (1)
612if (src.IsDense)
Standard\PoissonRegression\PoissonRegression.cs (1)
179Contracts.Assert(editor.Values.Length >= BiasCount && (grad.IsDense || editor.Indices[BiasCount - 1] == BiasCount - 1));
Standard\SdcaBinary.cs (1)
879if (features.IsDense)
Microsoft.ML.TestFramework (1)
DataPipe\TestDataPipe.cs (1)
1226Assert.True(value2.IsDense);
Microsoft.ML.TestFrameworkCommon (6)
TestCommon.cs (6)
145if (v1.IsDense && v2.IsDense) 157Assert.True(!v1.IsDense || !v2.IsDense); 164int iv1 = v1.IsDense ? iiv1 : iiv1 < v1Indices.Length ? v1Indices[iiv1] : v1.Length; 165int iv2 = v2.IsDense ? iiv2 : iiv2 < v2Indices.Length ? v2Indices[iiv2] : v2.Length;
Microsoft.ML.Tests (2)
TextLoaderTests.cs (2)
776Assert.True(featureValue.IsDense); 797Assert.True(featureValue.IsDense);
Microsoft.ML.Transforms (27)
Dracula\CountTableTransformer.cs (2)
284if (srcBuffer.IsDense) 711if (src.IsDense)
ExpressionTransformer.cs (6)
626if (!src0.IsDense) 640if (src0.IsDense) 683if (src0.IsDense) 746if (src0.IsDense) 812if (src0.IsDense) 881if (src0.IsDense)
GcnTransform.cs (1)
501if (!src.IsDense)
HashJoiningTransform.cs (1)
425!srcSlotNames.IsDense
LearnerFeatureSelection.cs (1)
180if (!scores.IsDense)
MissingValueDroppingTransformer.cs (2)
275if (!dst.IsDense) 323if (src.IsDense)
MissingValueIndicatorTransform.cs (1)
302if (buffer.IsDense)
MissingValueIndicatorTransformer.cs (1)
308if (src.IsDense)
MissingValueReplacing.cs (2)
722if (src.IsDense) 796if (src.IsDense)
MissingValueReplacingUtils.cs (1)
246if (src.IsDense)
MutualInformationFeatureSelection.cs (4)
567Contracts.Assert(labels.IsDense); 727Contracts.Assert(_labels.IsDense); 731if (features.IsDense) 901if (!input.IsDense && inputValues.Length > 0)
RandomFourierFeaturizing.cs (1)
566if (src.IsDense)
Text\LdaTransform.cs (2)
447if (input.IsDense) 519if (src.IsDense)
Text\NgramUtils.cs (1)
77if (src.IsDense)
UngroupTransform.cs (1)
656else if (row.IsDense)