2 writes to Host
Microsoft.ML.Data (2)
Dirty\ModelParametersBase.cs (2)
28Host = env.Register(name); 36Host = env.Register(name);
351 references to Host
Microsoft.ML.Data (2)
Dirty\ModelParametersBase.cs (2)
44Host.CheckDecode(cbFloat == sizeof(float), "This file was saved by an incompatible version"); 53Host.CheckValue(ctx, nameof(ctx));
Microsoft.ML.Ensemble (37)
Trainer\EnsembleDistributionModelParameters.cs (11)
84Host.AssertNonEmpty(Models); 92throw Host.Except("Predictor does not implement expected interface"); 98throw Host.Except("Predictor input type mismatch"); 142Host.Check(typeof(TIn) == typeof(VBuffer<Single>)); 143Host.Check(typeof(TOut) == typeof(Single)); 154Host.Check(src.Length == _inputType.Size); 178Host.Check(typeof(TIn) == typeof(VBuffer<Single>)); 179Host.Check(typeof(TOut) == typeof(Single)); 180Host.Check(typeof(TDist) == typeof(Single)); 192Host.Check(src.Length == _inputType.Size); 216Host.AssertValue(_mappers);
Trainer\EnsembleModelParameters.cs (6)
74Host.AssertNonEmpty(Models); 82throw Host.Except("Predictor does not implement expected interface"); 88throw Host.Except("Predictor input type mismatch"); 132Host.Check(typeof(TIn) == typeof(VBuffer<Single>)); 133Host.Check(typeof(TOut) == typeof(Single)); 146Host.Check(src.Length == _inputType.Size);
Trainer\EnsembleModelParametersBase.cs (11)
32Host.Check(Utils.Size(models) > 0, "Ensemble was created with no models."); 33Host.Check(weights == null || weights.Length == models.Length); 58Host.CheckDecode(count > 0); 61Host.CheckDecode(weightCount == 0 || weightCount == count); 68ctx.LoadModel<IPredictor, SignatureLoadModel>(Host, out IPredictor p, string.Format(SubPredictorFmt, i)); 70Host.Check(predictor != null, "Inner predictor type not compatible with the ensemble type."); 73Host.CheckDecode(numMetrics >= 0); 85ctx.LoadModel<IOutputCombiner<TOutput>, SignatureLoadModel>(Host, out Combiner, @"Combiner"); 112Host.AssertValueOrNull(model.SelectedFeatures); 114Host.AssertValueOrNull(model.Metrics); 132using (var ch = Host.Start("SaveAsText"))
Trainer\Multiclass\EnsembleMulticlassModelParameters.cs (9)
65Host.AssertNonEmpty(Models); 74throw Host.Except("Predictor does not implement expected interface"); 80throw Host.Except("Predictor input type mismatch"); 88Host.AssertValue(outputType); 112Host.Check(typeof(TIn) == typeof(VBuffer<Single>)); 113Host.Check(typeof(TOut) == typeof(VBuffer<Single>)); 123Host.Assert(_mappers[i].OutputType.GetVectorSize() > 0); 131Host.Check(src.Length == _inputType.Size); 146Host.Check(predictions[i].Length == _mappers[i].OutputType.GetVectorSize());
Microsoft.ML.FastTree (76)
FastTree.cs (28)
2839Host.CheckValue(trainedEnsemble, nameof(trainedEnsemble)); 2840Host.CheckParam(numFeatures > 0, nameof(numFeatures), "must be positive"); 2841Host.CheckValueOrNull(innerArgs); 2882Host.CheckDecode(NumFeatures >= 0); 2907Host.Assert(NumFeatures >= 0); 2913Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 2914Host.Check(typeof(TOut) == typeof(float)); 2924Host.Check(src.Length == inputVectorSize); 2926Host.Check(src.Length > MaxSplitFeatIdx); 2933Host.Check(typeof(TSrc) == typeof(VBuffer<float>)); 2934Host.Check(typeof(TDst) == typeof(VBuffer<float>)); 2935Host.Check(top >= 0, "top must be non-negative"); 2936Host.Check(bottom >= 0, "bottom must be non-negative"); 2952Host.Check(src.Length == inputVectorSize); 2954Host.Check(src.Length > MaxSplitFeatIdx); 2964Host.CheckValueOrNull(schema); 2973Host.CheckValue(writer, nameof(writer)); 2974Host.CheckValueOrNull(schema); 2983Host.CheckValue(writer, nameof(writer)); 2984var ensembleIni = FastTreeIniFileUtils.TreeEnsembleToIni(Host, TrainedEnsemble, schema, calibrator, 2991Host.CheckValue(ctx, nameof(ctx)); 2992Host.CheckValue(input, nameof(input)); 3040Host.CheckValue(ctx, nameof(ctx)); 3041Host.Check(Utils.Size(outputNames) >= 1); 3141Host.Assert(pair.Value is double); 3180Host.AssertValueOrNull(schema); 3395=> RegressionTreeBaseUtils.RegressionTreeEnsembleAsIDataView(Host, TrainedTreeEnsemble.Bias, TrainedTreeEnsemble.TreeWeights, TrainedTreeEnsemble.Trees); 3441=> RegressionTreeBaseUtils.RegressionTreeEnsembleAsIDataView(Host, TrainedTreeEnsemble.Bias, TrainedTreeEnsemble.TreeWeights, TrainedTreeEnsemble.Trees);
GamClassification.cs (1)
250Host.CheckValue(ctx, nameof(ctx));
GamModelParameters.cs (43)
67Host.CheckValue(binEffects, nameof(binEffects), "May not be null."); 68Host.CheckValue(binUpperBounds, nameof(binUpperBounds), "May not be null."); 69Host.CheckParam(binUpperBounds.Length == binEffects.Length, nameof(binUpperBounds), "Must have same number of features as binEffects"); 70Host.CheckParam(binEffects.Length > 0, nameof(binEffects), "Must have at least one entry"); 71Host.CheckParam(numInputFeatures == -1 || numInputFeatures > 0, nameof(numInputFeatures), "Must be greater than zero"); 72Host.CheckParam(shapeToInputMap == null || shapeToInputMap.Length == binEffects.Length, nameof(shapeToInputMap), "Must have same number of features as binEffects"); 88Host.CheckValue(binEffects[i], nameof(binEffects), "Array contained null entries"); 89Host.CheckParam(binUpperBounds[i].Length == binEffects[i].Length, nameof(binEffects), "Array contained wrong number of effect values"); 90Host.CheckParam(Utils.IsMonotonicallyIncreasing(binUpperBounds[i]), nameof(binUpperBounds), "Array must be monotonically increasing"); 107Host.CheckParam(0 <= _shapeToInputMap[i] && _shapeToInputMap[i] < _numInputFeatures, nameof(_shapeToInputMap), "Contains out of range feature value"); 108Host.CheckParam(!_inputFeatureToShapeFunctionMap.ContainsValue(_shapeToInputMap[i]), nameof(_shapeToInputMap), "Contains duplicate mappings"); 119Host.CheckValue(ctx, nameof(ctx)); 124Host.CheckDecode(NumberOfShapeFunctions >= 0); 126Host.CheckDecode(_numInputFeatures >= 0); 138Host.CheckDecode(Utils.Size(_binEffects[i]) >= 1); 146Host.CheckDecode(len >= 0); 153Host.CheckDecode(0 <= key && key < _numInputFeatures); 155Host.CheckDecode(0 <= val && val < NumberOfShapeFunctions); 156Host.CheckDecode(!_inputFeatureToShapeFunctionMap.ContainsKey(key)); 157Host.CheckDecode(_shapeToInputMap[val] == -1); 168Host.CheckValue(ctx, nameof(ctx)); 171Host.Assert(NumberOfShapeFunctions >= 0); 173Host.Assert(_numInputFeatures >= 0); 183Host.Assert(_binUpperBounds[i].Length == _binEffects[i].Length); 195Host.Check(typeof(TIn) == typeof(VBuffer<float>), "Input type does not match."); 196Host.Check(typeof(TOut) == typeof(float), "Output type does not match."); 204Host.CheckParam(features.Length == _numInputFeatures, nameof(features), "Bad length of input"); 235Host.CheckParam(features.Length == _numInputFeatures, nameof(features)); 236Host.CheckParam(Utils.Size(bins) == NumberOfShapeFunctions, nameof(bins)); 268Host.Assert(0 <= featureIndex && featureIndex < NumberOfShapeFunctions, "Index out of range."); 275Host.Check(0 <= featureIndex && featureIndex < NumberOfShapeFunctions, "Index out of range."); 287Host.Check(0 <= featureIndex && featureIndex < NumberOfShapeFunctions, "Index out of range."); 325Host.Check(0 <= featureIndex && featureIndex < NumberOfShapeFunctions, "Index out of range."); 358Host.CheckValue(writer, nameof(writer), "writer must not be null."); 359Host.CheckValueOrNull(schema); 405Host.Check(typeof(TSrc) == typeof(VBuffer<float>), "Source type does not match."); 406Host.Check(typeof(TDstContributions) == typeof(VBuffer<float>), "Destination type does not match."); 438Host.CheckValue(writer, nameof(writer), "writer must not be null"); 446Host.Check(effects.Length == binThresholds.Length, "Effects array must be same length as binUpperBounds array."); 468Host, ensemble, schema, calibrator, string.Empty, false, false); 491Host.Assert(internalNodeId == 0); 506Host.Assert(lower == upper + 1); 679var builder = new ArrayDataViewBuilder(pred.Host);
GamRegression.cs (1)
195Host.CheckValue(ctx, nameof(ctx));
RandomForestRegression.cs (3)
236Host.Check(src.Length == inputVectorSize); 238Host.Check(src.Length > MaxSplitFeatIdx); 262Host.CheckNonEmpty(quantiles, nameof(quantiles));
Microsoft.ML.KMeansClustering (15)
KMeansModelParameters.cs (15)
78Host.CheckParam(k > 0, nameof(k), "Need at least one cluster"); 79Host.CheckParam(Utils.Size(centroids) >= k, nameof(centroids), "Not enough centroids for predictor initialization"); 80Host.CheckParam(centroids[0].Length > 0, nameof(centroids), "Centroid vectors should have at least one length"); 89Host.CheckParam(centroids[i].Length == _dimensionality, 91Host.CheckParam(FloatUtils.IsFinite(centroids[i].GetValues()), 122Host.CheckDecode(_k > 0); 124Host.CheckDecode(_dimensionality > 0); 133Host.CheckDecode(0 <= count && count <= _dimensionality); 136Host.CheckDecode(FloatUtils.IsFinite(values)); 139WarnOnOldNormalizer(ctx, GetType(), Host); 149Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 150Host.Check(typeof(TOut) == typeof(VBuffer<float>)); 156throw Host.Except($"Incorrect number of features: expected {_dimensionality}, got {src.Length}"); 167Host.Assert(distances.Length >= _k); 185Host.Assert(_dimensionality == _centroids[i].Length);
Microsoft.ML.Mkl.Components (3)
OlsLinearRegression.cs (3)
818Host.CheckDecode(Weight.IsDense); 827Host.CheckDecode(!Double.IsNaN(RSquaredAdjusted) || !hasStats); 833Host.CheckDecode(FloatUtils.IsFinite(_standardErrors[i]) && _standardErrors[i] >= 0);
Microsoft.ML.PCA (11)
PcaTrainer.cs (11)
464Host.CheckParam(_eigenVectors[i].GetValues().All(FloatUtils.IsFinite), 486Host.CheckDecode(FloatUtils.IsFinite(_dimension)); 489Host.CheckDecode(FloatUtils.IsFinite(_rank)); 495Host.CheckDecode(meanArray.All(FloatUtils.IsFinite)); 510Host.CheckDecode(vi.All(FloatUtils.IsFinite)); 514WarnOnOldNormalizer(ctx, GetType(), Host); 589var bldr = new ArrayDataViewBuilder(Host); 619Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 620Host.Check(typeof(TOut) == typeof(float)); 625Host.Check(src.Length == _dimension); 633Host.Assert(src.Length == _dimension);
Microsoft.ML.StandardTrainers (199)
FactorizationMachine\FieldAwareFactorizationMachineModelParameters.cs (27)
79Host.Assert(fieldCount > 0); 80Host.Assert(featureCount > 0); 81Host.Assert(latentDim > 0); 82Host.Assert(Utils.Size(linearWeights) == featureCount); 84Host.Assert(Utils.Size(latentWeights) == checked(featureCount * fieldCount * LatentDimAligned)); 114Host.Assert(fieldCount > 0); 115Host.Assert(featureCount > 0); 116Host.Assert(latentDim > 0); 117Host.Assert(Utils.Size(linearWeights) == featureCount); 119Host.Assert(latentWeightsAligned.Size == checked(featureCount * fieldCount * LatentDimAligned)); 131Host.AssertValue(ctx); 143Host.CheckDecode(fieldCount > 0); 145Host.CheckDecode(featureCount > 0); 147Host.CheckDecode(latentDim > 0); 149Host.Check(checked(featureCount * fieldCount * LatentDimAligned) <= Utils.ArrayMaxSize, "Latent dimension too large"); 151Host.CheckDecode(Utils.Size(linearWeights) == featureCount); 153Host.CheckDecode(Utils.Size(latentWeights) == featureCount * fieldCount * latentDim); 188Host.AssertValue(ctx); 202Host.Assert(FieldCount > 0); 203Host.Assert(FeatureCount > 0); 204Host.Assert(LatentDimension > 0); 205Host.Assert(Utils.Size(_linearWeights) == FeatureCount); 206Host.Assert(_latentWeightsAligned.Size == FeatureCount * FieldCount * LatentDimAligned); 244Host.AssertValue(_linearWeights); 245Host.AssertValue(linearWeights); 251Host.AssertValue(_latentWeightsAligned); 252Host.AssertValue(latentWeights);
LdSvm\LdSvmModelParameters.cs (47)
58Host.Assert(treeDepth > 0 && treeDepth < 31); 61Host.Assert(w.Length == numLeaf * 2 - 1); 62Host.Assert(w.All(v => v.IsDense)); 63Host.Assert(w.All(v => v.Length == w[0].Length)); 64Host.Assert(thetaPrime.Length == numLeaf * 2 - 1); 65Host.Assert(thetaPrime.All(v => v.IsDense)); 66Host.Assert(thetaPrime.All(v => v.Length == thetaPrime[0].Length)); 67Host.Assert(theta.Length == numLeaf - 1); 68Host.Assert(theta.All(v => v.IsDense)); 69Host.Assert(theta.All(v => v.Length == theta[0].Length)); 70Host.Assert(biasW.Length == numLeaf * 2 - 1); 71Host.Assert(biasTheta.Length == numLeaf - 1); 72Host.Assert(biasThetaPrime.Length == numLeaf * 2 - 1); 73Host.Assert((w[0].Length > 0) && (w[0].Length == thetaPrime[0].Length) && (w[0].Length == theta[0].Length)); 107Host.CheckDecode(_numLeaf > 1 && (_numLeaf & (_numLeaf - 1)) == 0); 109Host.CheckDecode(numFeatures > 0); 119WarnOnOldNormalizer(ctx, GetType(), Host); 128Host.Assert(_numLeaf > 1 && (_numLeaf & (_numLeaf - 1)) == 0); // Check if _numLeaf is power of 2 129Host.Assert(_w.Length == _numLeaf * 2 - 1); 130Host.Assert(_w.All(v => v.IsDense)); 131Host.Assert(_w.All(v => v.Length == _w[0].Length)); 132Host.Assert(_thetaPrime.Length == _numLeaf * 2 - 1); 133Host.Assert(_thetaPrime.All(v => v.IsDense)); 134Host.Assert(_thetaPrime.All(v => v.Length == _thetaPrime[0].Length)); 135Host.Assert(_theta.Length == _numLeaf - 1); 136Host.Assert(_theta.All(v => v.IsDense)); 137Host.Assert(_theta.All(v => v.Length == _theta[0].Length)); 138Host.Assert(_biasW.Length == _numLeaf * 2 - 1); 139Host.Assert(_biasTheta.Length == _numLeaf - 1); 140Host.Assert(_biasThetaPrime.Length == _numLeaf * 2 - 1); 141Host.Assert((_w[0].Length > 0) && (_w[0].Length == _thetaPrime[0].Length) && (_w[0].Length == _theta[0].Length)); // numFeatures 142Host.Assert(InputType != null && InputType.GetVectorSize() == _w[0].Length); 186Host.Assert(_w.Length == _numLeaf * 2 - 1); 188Host.Assert(_thetaPrime.Length == _numLeaf * 2 - 1); 190Host.Assert(_theta.Length == _numLeaf - 1); 193Host.Assert(_biasW.Length == _numLeaf * 2 - 1); 195Host.Assert(_biasTheta.Length == _numLeaf - 1); 197Host.Assert(_biasThetaPrime.Length == _numLeaf * 2 - 1); 215Host.Assert(vector.IsDense); 216Host.Assert(vector.Length == vectorLength); 230Host.Assert(length >= 0); 231Host.Assert(vectorLength >= 0); 238Host.Assert(result[i].IsDense); 239Host.Assert(result[i].Length == vectorLength); 270Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 271Host.Check(typeof(TOut) == typeof(float)); 276Host.Check(src.Length == InputType.GetVectorSize());
Standard\LinearModelParameters.cs (36)
123Host.CheckParam(FloatUtils.IsFinite(weights.GetValues()), nameof(weights), "Cannot initialize linear predictor with non-finite weights"); 124Host.CheckParam(FloatUtils.IsFinite(bias), nameof(bias), "Cannot initialize linear predictor with non-finite bias"); 138Host.CheckValue(ctx, nameof(ctx)); 139Host.Check(Utils.Size(outputs) >= 1); 169Host.CheckDecode(FloatUtils.IsFinite(Bias)); 172Host.Assert(len > 0); 175Host.CheckDecode(0 <= cind && cind < len); 182Host.CheckDecode(prev < indices[i]); 185Host.CheckDecode(prev < len); 192Host.CheckDecode(cwht == cind || (cind == 0 && cwht == len)); 195Host.CheckDecode(Utils.Size(weights) == 0 || weights.All(x => FloatUtils.IsFinite(x))); 203WarnOnOldNormalizer(ctx, GetType(), Host); 233Host.CheckValue(ctx, nameof(ctx)); 234Host.CheckValue(input, nameof(input)); 354Host.CheckValue(writer, nameof(writer)); 355Host.CheckValue(schema, nameof(schema)); 362Host.CheckValue(writer, nameof(writer)); 363Host.CheckValue(schema, nameof(schema)); 470ctx.LoadModelOrNull<LinearModelParameterStatistics, SignatureLoadModel>(Host, out stats, ModelStatsSubModelFilename); 476ctx.LoadModelOrNull<ModelStatisticsBase, SignatureLoadModel>(Host, out stats, ModelStatsSubModelFilename); 520return new LinearBinaryModelParameters(Host, in weights, bias); 525Host.CheckValue(schema, nameof(schema)); 538Host.CheckValue(schema, nameof(schema)); 559Host.CheckValue(writer, nameof(writer)); 560Host.CheckValue(schema, nameof(schema)); 561Host.CheckValueOrNull(calibrator); 594throw Host.ExceptNotImpl("Saving calibrators is not implemented yet."); 596Host.CheckValue(writer, nameof(writer)); 597Host.CheckValue(schema, nameof(schema)); 660Host.CheckValue(writer, nameof(writer)); 661Host.CheckValue(schema, nameof(schema)); 677return new LinearRegressionModelParameters(Host, in weights, bias); 683Host.CheckValue(schema, nameof(schema)); 761Host.CheckValue(writer, nameof(writer)); 762Host.CheckValue(schema, nameof(schema)); 778return new PoissonRegressionModelParameters(Host, in weights, bias);
Standard\LogisticRegression\MulticlassLogisticRegression.cs (38)
552Host.CheckDecode(NumberOfFeatures >= 1); 555Host.CheckDecode(NumberOfClasses >= 1); 565Host.CheckDecode(numIndices == 0); 567Host.CheckDecode(numWeights == NumberOfClasses * NumberOfFeatures); 579Host.CheckDecode(numStarts == NumberOfClasses + 1); 581Host.CheckDecode(starts[0] == 0); 582Host.CheckDecode(Utils.IsMonotonicallyIncreasing(starts)); 585Host.CheckDecode(numIndices == starts[starts.Length - 1]); 591Host.CheckDecode(Utils.IsIncreasing(0, indices[i], NumberOfFeatures)); 595Host.CheckDecode(numValues == numIndices); 604WarnOnOldNormalizer(ctx, GetType(), Host); 618ctx.LoadModelOrNull<ModelStatisticsBase, SignatureLoadModel>(Host, out stats, ModelStatsSubModelFilename); 629Host.Assert(Biases.Length == NumberOfClasses); 630Host.Assert(Biases.Length == Weights.Length); 633Host.Assert(fw.Length == NumberOfFeatures); 664Host.Assert(fv.Length == NumberOfFeatures); 714Host.Assert(count == numIndices); 741Host.Assert(count == numIndices); 769Host.Check(typeof(TSrc) == typeof(VBuffer<float>), "Invalid source type in GetMapper"); 770Host.Check(typeof(TDst) == typeof(VBuffer<float>), "Invalid destination type in GetMapper"); 775Host.Check(src.Length == NumberOfFeatures); 784Host.Check(src.Length == NumberOfFeatures, "src length should equal the number of features"); 819Host.AssertValue(_weightsDense); 834Host.CheckValueOrNull(schema); 878Host.Assert(namedValues.Value is float); 906Host.CheckValue(writer, nameof(writer)); 907Host.CheckValueOrNull(schema); 937Host.CheckValue(ctx, nameof(ctx)); 938Host.CheckValue(input, nameof(input)); 980Host.CheckValue(ctx, nameof(ctx)); 985Host.Assert(outputs[0] == DefaultColumnNames.PredictedLabel); 986Host.Assert(outputs[1] == DefaultColumnNames.Score); 1052Host.Assert(featuresCount == Weights[i].Length); 1073Host.CheckDecode(0 <= id && id < Utils.Size(ctx.Strings)); 1075Host.CheckDecode(str.Length > 0); 1089Host.AssertValue(_labelNames[i]); 1096var bldr = new ArrayDataViewBuilder(Host); 1241Host.Assert(dst.Length == NumberOfClasses);
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (11)
294Host.AssertValue(labelHistogram); 295Host.AssertValue(featureHistogram); 296Host.Assert(labelHistogram.Length == featureHistogram.Length); 297Host.Assert(featureHistogram.All(h => h == null || h.Length == featureCount)); 331Host.CheckDecode(labelCount >= 0); 334Host.CheckDecode(_featureCount >= 0); 345Host.CheckDecode(_featureHistogram[iLabel][iFeature] >= 0); 412Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 413Host.Check(typeof(TOut) == typeof(VBuffer<float>)); 591Host.Assert(featureCount >= 0); 598Host.Check(src.Length == _featureCount, "Invalid number of features passed.");
Standard\MulticlassClassification\OneVersusAllTrainer.cs (16)
359Host.AssertValue(impl, nameof(impl)); 360Host.Assert(Utils.Size(impl.Predictors) > 0); 374Host.CheckDecode(len > 0); 379LoadPredictors(Host, predictors, ctx); 385LoadPredictors(Host, predictors, ctx); 391LoadPredictors(Host, predictors, ctx); 434Host.CheckValue(ctx, nameof(ctx)); 435Host.CheckValue(input, nameof(input)); 450Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 451Host.Check(typeof(TOut) == typeof(VBuffer<float>)); 458Host.CheckValue(writer, nameof(writer)); 459Host.CheckValue(schema, nameof(schema)); 467Host.Check(saveInSourceCode != null, "Saving in code is not supported."); 478Host.CheckValue(writer, nameof(writer)); 479Host.CheckValue(schema, nameof(schema)); 486Host.Check(saveInText != null, "Saving in text is not supported.");
Standard\MulticlassClassification\PairwiseCouplingTrainer.cs (20)
265Host.Assert(Utils.Size(predictors) > 0); 273Host.Assert(Utils.Size(predictors[i]) == i + 1); 276Host.Assert(index == GetIndex(i, j)); 280Host.Assert(index == _predictors.Length); 292Host.CheckDecode(_numClasses > 0); 295Host.CheckDecode(count <= int.MaxValue); 304Host.Assert(index == GetIndex(i, j)); 305ctx.LoadModel<TDistPredictor, SignatureLoadModel>(Host, out _predictors[index++], string.Format(SubPredictorFmt2, i, j)); 307Host.Assert(index == GetIndex(i, i)); 308ctx.LoadModel<TDistPredictor, SignatureLoadModel>(Host, out _predictors[index++], string.Format(SubPredictorFmt, i)); 321Host.Check(IsValid(vmd, ref inputType), "Predictor doesn't implement the expected interface"); 381Host.Assert(0 <= value && value <= 1); 414Host.Assert(index == GetIndex(j, i)); 435Host.Assert(values[index + j] >= pii); 442Host.Assert(index == GetIndex(j, i)); 443Host.Assert(values[index] >= pii); 454Host.Assert(0 <= j && j <= i && i < _numClasses); 460Host.Check(typeof(TIn) == typeof(VBuffer<float>)); 461Host.Check(typeof(TOut) == typeof(VBuffer<float>)); 472Host.Check(src.Length == _inputType.Size);
Standard\Simple\SimpleTrainers.cs (4)
361Host.Check(!float.IsNaN(prob)); 376Host.CheckDecode(!float.IsNaN(_prob)); 405Host.CheckValue(ctx, nameof(ctx)); 406Host.Check(Utils.Size(outputs) >= 3);
Microsoft.ML.Vision (8)
ImageClassificationTrainer.cs (8)
1362Host.AssertValue(session); 1363Host.Assert(classCount > 1); 1364Host.AssertNonEmpty(imagePreprocessorTensorInput); 1365Host.AssertNonEmpty(imagePreprocessorTensorOutput); 1366Host.AssertNonEmpty(graphInputTensor); 1367Host.AssertNonEmpty(graphOutputTensor); 1475Host.Check(typeof(TSrc) == typeof(VBuffer<byte>)); 1476Host.Check(typeof(TDst) == typeof(VBuffer<float>));