1 write to Host
Microsoft.ML.Data (1)
Transforms\RowToRowTransformerBase.cs (1)
22Host = host;
363 references to Host
Microsoft.ML.Data (106)
Prediction\CalibratorCatalog.cs (2)
250base(parent.Host, inputSchema, parent) 258parent.Host.Check(_scoreColIndex >= 0, "The data to calibrate contains no \'" + scoreColumnName + "\' column.");
Transforms\ColumnConcatenatingTransformer.cs (3)
265Host.CheckValue(ctx, nameof(ctx)); 286Host.CheckValue(ctx, nameof(ctx)); 429base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), inputSchema, parent)
Transforms\ColumnCopying.cs (1)
207: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\FeatureContributionCalculationTransformer.cs (8)
92Host.CheckValue(modelParameters, nameof(modelParameters)); 93Host.CheckNonEmpty(featureColumnName, nameof(featureColumnName)); 95throw Host.Except($"Number of top contribution must be non negative"); 97throw Host.Except($"Number of bottom contribution must be non negative"); 102Host.AssertValue(_predictor); 112Host.AssertValue(ctx); 131Host.CheckValue(ctx, nameof(ctx)); 176: base(parent.Host, parent, schema)
Transforms\Hashing.cs (26)
152throw Host.ExceptParam(nameof(inputSchema), HashingEstimator.ExpectedColumnType); 185throw Host.ExceptParam(nameof(columns), $"Found column with {nameof(column.MaximumNumberOfInverts)} set to non zero value, please use {nameof(HashingEstimator)} instead"); 188throw Host.ExceptParam(nameof(HashingEstimator.ColumnOptions.Combine), "When the 'Combine' option is specified, ordered hashing is not supported."); 204throw Host.ExceptSchemaMismatch(nameof(input), "input", ColumnPairs[i].inputColumnName); 229using (var ch = Host.Start("Invert hash building")) 236Host.Assert(types[iinfo].GetItemType().GetKeyCount() > 0); 238Host.Assert(disposer == null); 253Host.Assert(_keyValues[invertIinfos[i]].Length == types[invertIinfos[i]].GetItemType().GetKeyCountAsInt32(Host)); 263Host.AssertValue(input); 264Host.Assert(0 <= iinfo && iinfo < _columns.Length); 296TextModelHelper.LoadAll(Host, ctx, columnsLength, out _keyValues, out _kvTypes); 301Host.CheckValue(ctx, nameof(ctx)); 311Host.Assert(_columns.Length == ColumnPairs.Length); 315TextModelHelper.SaveAll(Host, ctx, _columns.Length, _keyValues); 352Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 369Host.Assert(srcType.RawType == typeof(byte)); 398Host.Assert(srcType.RawType == typeof(bool)); 404Host.Assert(HashingEstimator.IsColumnTypeValid(srcType.ItemType)); 416Host.Assert(rawType == typeof(ulong)); 445Host.Assert(srcType.ItemType == TextDataViewType.Instance); 452Host.Assert(srcType.ItemType.RawType == typeof(T)); 466Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 481Host.Assert(rawType == typeof(byte)); 510Host.Assert(rawType == typeof(bool)); 1317: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\KeyToValue.cs (2)
144Host.CheckValue(ctx, nameof(ctx)); 163: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\KeyToVector.cs (4)
119throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, reason, type.ToString()); 146Host.CheckValue(ctx, nameof(ctx)); 155Host.Assert(_columns.Length == ColumnPairs.Length); 244: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\Normalizer.cs (8)
627ctx.LoadModel<IColumnFunction, SignatureLoadColumnFunction>(Host, out var function, dir, Host, typeSrc); 648ctx.LoadModel<IColumnFunction, SignatureLoadColumnFunction>(Host, out var function, dir, Host, typeSrc); 681Host.CheckValue(ctx, nameof(ctx)); 708throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, expectedType, "variable-size vector"); 711throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, expectedType, colType.ToString()); 728: base(parent.Host.Register(nameof(Mapper)), parent, schema)
Transforms\OneToOneTransformerBase.cs (2)
58Host.CheckValue(ctx, nameof(ctx)); 80throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName);
Transforms\RowToRowTransformerBase.cs (6)
33Host.CheckValue(inputSchema, nameof(inputSchema)); 34return new RowToRowMapperTransform(Host, new EmptyDataView(Host, inputSchema), MakeRowMapper(inputSchema), MakeRowMapper); 42Host.CheckValue(inputSchema, nameof(inputSchema)); 52Host.CheckValue(input, nameof(input)); 53return new RowToRowMapperTransform(Host, input, MakeRowMapper(input.Schema), MakeRowMapper);
Transforms\SlotsDroppingTransformer.cs (11)
277Host.AssertNonEmpty(ColumnPairs); 279Host.CheckUserArg(AreRangesValid(SlotsMin, SlotsMax), nameof(columns), "The range min and max must be non-negative and min must be less than or equal to max."); 285Host.AssertValue(ctx); 292Host.AssertNonEmpty(ColumnPairs); 299Host.CheckDecode(Utils.Size(SlotsMin[i]) > 0); 302Host.Assert(AreRangesValid(SlotsMin, SlotsMax)); 330Host.CheckValue(ctx, nameof(ctx)); 342Host.Assert(AreRangesValid(SlotsMin, SlotsMax)); 345Host.Assert(SlotsMin[i].Length == SlotsMax[i].Length); 358Host.CheckUserArg(range.IsValid(), nameof(col.Slots), "The range min and max must be non-negative and min must be less than or equal to max."); 470: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\TypeConverting.cs (7)
208Host.CheckValue(ctx, nameof(ctx)); 222Host.Assert((InternalDataKind)(byte)_columns[i].OutputKind.ToInternalDataKind() == _columns[i].OutputKind.ToInternalDataKind()); 266Host.CheckDecode(Enum.IsDefined(typeof(InternalDataKind), kind)); 276Host.CheckDecode(min == 0); 281Host.CheckDecode(contiguous); 286Host.CheckDecode(0 < count); 393: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\ValueMapping.cs (13)
438_dataView = GetBytesFromDataView(Host, lookupMap, lookupKeyColumn.Name, lookupValueColumn.Name); 447Host.Check(column.HasValue, "The selected column " + nameof(keyColumn) + " is not included in the targeted IDataView " + nameof(dataView)); 449Host.Check(retrievedKeyColumn.Index == keyColumn.Index, nameof(keyColumn) + "'s column index doesn't match that of the associated column in " + nameof(dataView)); 450Host.Check(retrievedKeyColumn.Type == keyColumn.Type, nameof(keyColumn) + "'s column type doesn't match that of the associated column in " + nameof(dataView)); 451Host.Check(retrievedKeyColumn.Annotations == keyColumn.Annotations, nameof(keyColumn) + "'s column annotations don't match those of the associated column in " + nameof(dataView)); 455Host.Check(column.HasValue, "The selected column " + nameof(valueColumn) + " is not included in the targeted IDataView " + nameof(dataView)); 457Host.Check(retrievedValueColumn.Index == valueColumn.Index, nameof(valueColumn) + "'s column index doesn't match that of the associated column in " + nameof(dataView)); 458Host.Check(retrievedValueColumn.Type == valueColumn.Type, nameof(valueColumn) + "'s column type doesn't match that of the associated column in " + nameof(dataView)); 459Host.Check(retrievedValueColumn.Annotations == valueColumn.Annotations, nameof(valueColumn) + "'s column annotations don't match those of the associated column in " + nameof(dataView)); 464valueMap.Train(Host, cursor); 785Host.CheckValue(ctx, nameof(ctx)); 1040: base(transform.Host.Register(nameof(Mapper)), transform, inputSchema) 1284throw _parent.Host.ExceptNotSupp("Column '{0}' cannot be mapped to values when the column and the map values are both vector type.", _columns[i].inputColumnName);
Transforms\ValueToKeyMappingTransformer.cs (13)
190Interlocked.CompareExchange(ref _codecFactory, new CodecFactory(Host, _codecFactoryPool), null); 192Host.Assert(_codecFactory != null); 230Host.AssertValue(inputSchema); 235throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[i].inputColumnName); 239throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[i].inputColumnName, reason, type.ToString()); 254using (var ch = Host.Start("Training")) 257_unboundMaps = Train(Host, ch, infos, keyData, columns, input, autoConvert); 654Host.CheckValue(ctx, nameof(ctx)); 661Host.Assert(_unboundMaps.Length == _textMetadata.Length); 662Host.Assert(_textMetadata.Length == ColumnPairs.Length); 676Host.CheckValue(c, nameof(ctx)); 681term.Save(c, Host, CodecFactory); 717: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Microsoft.ML.ImageAnalytics (24)
ImageGrayscale.cs (3)
131Host.CheckValue(ctx, nameof(ctx)); 146throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, "image", inputSchema[srcCol].Type.ToString()); 154: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
ImageLoader.cs (3)
161throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, TextDataViewType.Instance.ToString(), inputSchema[srcCol].Type.ToString()); 166Host.CheckValue(ctx, nameof(ctx)); 200: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
ImagePixelExtractor.cs (5)
248Host.CheckValue(ctx, nameof(ctx)); 272throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, "image", inputSchema[srcCol].Type.ToString()); 274throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, "known-size image", "unknown-size image"); 276throw Host.Except("Image dimensions are too large"); 285: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
ImageResizer.cs (7)
203Host.CheckDecode(width > 0); 205Host.CheckDecode(height > 0); 207Host.CheckDecode(Enum.IsDefined(typeof(ImageResizingEstimator.ResizingKind), scale)); 209Host.CheckDecode(Enum.IsDefined(typeof(ImageResizingEstimator.Anchor), anchor)); 224Host.CheckValue(ctx, nameof(ctx)); 256throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", _columns[col].InputColumnName, "image", inputSchema[srcCol].Type.ToString()); 264: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
VectorToImageTransform.cs (6)
181Host.AssertNonEmpty(columns); 240Host.AssertValue(ctx); 277Host.CheckValue(ctx, nameof(ctx)); 304throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, "image", inputSchema[srcCol].Type.ToString()); 307throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputColName, new VectorDataViewType(vectorType.ItemType, _columns[col].ImageHeight, _columns[col].ImageWidth, _columns[col].Planes).ToString(), vectorType.ToString()); 316: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Microsoft.ML.Mkl.Components (7)
VectorWhitening.cs (7)
150Host.AssertNonEmpty(ColumnPairs); 159Host.AssertValue(ctx); 169Host.AssertNonEmpty(ColumnPairs); 216throw Host.ExceptParam(nameof(inputSchema), reason); 466Host.CheckValue(ctx, nameof(ctx)); 480Host.Assert(_columns.Length == ColumnPairs.Length); 557: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Microsoft.ML.OnnxTransformer (11)
OnnxTransform.cs (11)
238Host.CheckValue(options, nameof(options)); 241Host.CheckNonWhiteSpace(col, nameof(options.InputColumns)); 243Host.CheckNonWhiteSpace(col, nameof(options.OutputColumns)); 262Host.CheckNonWhiteSpace(options.ModelFile, nameof(options.ModelFile)); 263Host.CheckIO(File.Exists(options.ModelFile), "Model file {0} does not exists.", options.ModelFile); 271Host.CheckValue(options.ModelBytes, nameof(options.ModelBytes)); 285throw Host.Except(e, $"Error initializing model :{e.ToString()}"); 419Host.AssertValue(ctx); 426Host.CheckNonEmpty(Inputs, nameof(Inputs)); 431Host.CheckNonEmpty(Outputs, nameof(Outputs)); 507base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), inputSchema, parent)
Microsoft.ML.PCA (12)
PcaTransformer.cs (12)
207Host.AssertNonEmpty(ColumnPairs); 216ValidatePcaInput(Host, colInfo.InputColumnName, sInfo.InputType); 226Host.AssertValue(ctx); 232Host.AssertNonEmpty(ColumnPairs); 283Host.CheckValue(ctx, nameof(ctx)); 309var rnd = columns[iinfo].Seed == null ? Host.Rand : new Random(columns[iinfo].Seed.Value); 317using (var ch = Host.Start("Memory usage")) 341using (var ch = Host.Start("Memory usage")) 393Host.Assert(mean.Length == omega.Length && omega.Length == y.Length && y.Length == _numColumns); 455throw Host.Except("Empty data in column '{0}'", ColumnPairs[iinfo].inputColumnName); 504ValidatePcaInput(Host, inputSchema[srcCol].Name, inputSchema[srcCol].Type); 544: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Microsoft.ML.TensorFlow (11)
TensorflowTransform.cs (11)
292Host.CheckValue(session, nameof(session)); 293Host.CheckNonEmpty(inputColumnNames, nameof(inputColumnNames)); 294Host.CheckNonEmpty(outputColumnNames, nameof(outputColumnNames)); 305(TFOutputTypes, OutputTypes, TFOutputOperations) = GetOutputInfo(Host, Session, Outputs, treatOutputAsBatched); 306(TFInputTypes, TFInputShapes, TFInputOperations) = GetInputInfo(Host, Session, Inputs, batchSize); 435Host.AssertValue(ctx); 489Host.Assert(actualWritten == fileLength); 495Host.AssertNonEmpty(Inputs); 500Host.AssertNonEmpty(Outputs); 527DeleteFolderWithRetries(Host, _savedModelPath); 543base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), inputSchema, parent)
Microsoft.ML.TorchSharp (27)
AutoFormerV2\ObjectDetectionTrainer.cs (7)
541Host.CheckValue(inputSchema, nameof(inputSchema)); 577throw Host.ExceptSchemaMismatch(nameof(inputSchema), "Image", Options.ImageColumnName); 579throw Host.ExceptSchemaMismatch(nameof(inputSchema), "Image", Options.ImageColumnName, 596Host.AssertValue(ctx); 640BinarySaver saver = new BinarySaver(Host, new BinarySaver.Arguments()); 644throw Host.Except("We do not know how to serialize label names of type '{0}'", labelColType.ItemType); 731base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(ObjDetMapper)), inputSchema, parent)
NasBert\NasBertTrainer.cs (5)
429Host.CheckValue(inputSchema, nameof(inputSchema)); 459throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence", SentenceColumn.Name); 461throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence", SentenceColumn.Name, 467throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", SentenceColumn2.Name); 469throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", SentenceColumn2.Name,
NasBert\NerTrainer.cs (2)
291BinarySaver saver = new BinarySaver(Host, new BinarySaver.Arguments()); 295throw Host.Except("We do not know how to serialize label names of type '{0}'", labelColType.ItemType);
NasBert\TextClassificationTrainer.cs (2)
228BinarySaver saver = new BinarySaver(Host, new BinarySaver.Arguments()); 232throw Host.Except("We do not know how to serialize label names of type '{0}'", labelColType.ItemType);
Roberta\QATrainer.cs (8)
584using (var ch = Host.Start("Initialize Tokenizer")) 590Host.CheckValue(inputSchema, nameof(inputSchema)); 618throw Host.ExceptSchemaMismatch(nameof(inputSchema), "Context", Options.ContextColumnName); 620throw Host.ExceptSchemaMismatch(nameof(inputSchema), "Context", Options.ContextColumnName, 624throw Host.ExceptSchemaMismatch(nameof(inputSchema), "Question", Options.QuestionColumnName); 626throw Host.ExceptSchemaMismatch(nameof(inputSchema), "Question", Options.QuestionColumnName, 643Host.AssertValue(ctx); 713base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(QAMapper)), inputSchema, parent)
TorchSharpBaseTrainer.cs (3)
405Host.CheckValue(inputSchema, nameof(inputSchema)); 418Host.AssertValue(ctx); 456base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(TorchSharpBaseMapper)), inputSchema, parent)
Microsoft.ML.Transforms (133)
Dracula\CountTableTransformer.cs (8)
445Host.AssertValue(featurizer); 446Host.AssertValueOrNull(labelClassNames); 447Host.Assert(Utils.Size(seeds) == featurizer.ColCount); 543Host.CheckDecode(lc >= 0); 559Host.CheckValue(ctx, nameof(ctx)); 579Host.Assert(!string.IsNullOrEmpty(_labelClassNames[i])); 590return new RowToRowMapperTransform(Host, input, MakeRowMapperWithNoise(input.Schema), MakeRowMapperWithNoise); 603: base(parent.Host.Register(nameof(Mapper)), parent, schema)
ExpressionTransformer.cs (7)
308Host.AssertNonEmpty(columns); 386Host.CheckValue(ctx, nameof(ctx)); 412Host.Assert(_columns[i].VectorInputColumn >= -1); 930: base(parent.Host, inputSchema, parent) 968_parent.Host.Assert(0 <= iinfo && iinfo < _parent._columns.Length); 972return _parent.MakeGetterVec(_parent.Host, input, iinfo); 973return _parent.MakeGetter(_parent.Host, input, iinfo);
GcnTransform.cs (4)
199throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputSchema[srcCol].Name, LpNormNormalizingEstimatorBase.ExpectedColumnType, inType.ToString()); 300Host.CheckValue(ctx, nameof(ctx)); 310Host.Assert(_columns.Length == ColumnPairs.Length); 327: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
KeyToVectorMapping.cs (3)
76throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, reason, type.ToString()); 86Host.CheckValue(ctx, nameof(ctx)); 168: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
MissingValueDroppingTransformer.cs (6)
125Host.CheckValue(ctx, nameof(ctx)); 135throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", inputSchema[srcCol].Name, "vector", inType.ToString()); 164Host.CheckValue(ctx, nameof(ctx)); 185base(parent.Host.Register(nameof(Mapper)), parent, inputSchema) 197throw _parent.Host.Except($"Column '{srcCol.Name}' is not a vector column"); 199throw _parent.Host.Except($"Column '{srcCol.Name}' is of type {srcCol.Type.GetItemType()}, which does not support missing values");
MissingValueIndicatorTransformer.cs (3)
104Host.CheckValue(ctx, nameof(ctx)); 136Host.CheckValue(ctx, nameof(ctx)); 177: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
MissingValueReplacing.cs (24)
207throw Host.ExceptParam(nameof(inputSchema), reason); 217throw Host.ExceptSchemaMismatch(nameof(input), "input", ColumnPairs[i].inputColumnName); 230var saver = new BinarySaver(Host, new BinarySaver.Arguments()); 234throw Host.ExceptDecode(); 249Host.Assert(repValue.GetType() == _replaceTypes[i].RawType || repValue.GetType() == _replaceTypes[i].GetItemType().RawType); 255Host.Assert(srcType != null); 256Host.Assert(srcType.Size == src.Length); 268Host.Assert(valReturn.Length == src.Length); 312throw Host.Except("Cannot perform mean imputations on non-numeric '{0}'", type.GetItemType()); 318Host.Assert(false); 319throw Host.Except("Internal error, undefined ReplacementKind '{0}' assigned in NAReplaceTransform.", columns[iinfo].Replacement); 328using (var ch = Host.Start("Computing Statistics")) 369Host.Assert(values.Length == type.GetVectorSize()); 481Host.AssertValue(array); 487Host.AssertValue(stream); 488Host.AssertValue(saver); 489Host.Assert(type.RawType == typeof(T) || type.GetItemType().RawType == typeof(T)); 492throw Host.Except("We do not know how to serialize terms of type '{0}'", type); 497Host.CheckValue(ctx, nameof(ctx)); 503var saver = new BinarySaver(Host, new BinarySaver.Arguments()); 510Host.Assert(repValue is Array); 516Host.Assert(!(repValue is Array)); 519Host.Assert(repValue.GetType() == _replaceTypes[iinfo].RawType || repValue.GetType() == _replaceTypes[iinfo].GetItemType().RawType); 557: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
RandomFourierFeaturizing.cs (10)
247throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, reason, type.ToString()); 249throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, 262_transformInfos[i] = new TransformInfo(Host.Register(string.Format("column{0}", i)), columns[i], 288throw Host.ExceptSchemaMismatch(nameof(input), "input", ColumnPairs[i].inputColumnName); 292throw Host.ExceptSchemaMismatch(nameof(input), "input", ColumnPairs[i].inputColumnName, reason, type.ToString()); 301var rng = columns[i].Seed.HasValue ? RandomUtils.Create(columns[i].Seed.Value) : Host.Rand; 367Host.Assert(count == distances.Length); 404_transformInfos[i] = new TransformInfo(Host, ctx, 455Host.CheckValue(ctx, nameof(ctx)); 477: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Text\LdaTransform.cs (5)
568: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema) 664Host.AssertNonEmpty(ColumnPairs); 672Host.AssertValue(ctx); 685_ldas[i] = new LdaState(Host, ctx); 756Host.CheckValue(ctx, nameof(ctx));
Text\NgramHashingTransformer.cs (10)
187throw Host.ExceptParam(nameof(columns), $"Found colunm with {nameof(column.MaximumNumberOfInverts)} set to non zero value, please use {nameof(NgramHashingEstimator)} instead"); 215throw Host.ExceptSchemaMismatch(nameof(input), "input", _columns[i].InputColumnNamesArray[j]); 218throw Host.ExceptSchemaMismatch(nameof(input), "input", _columns[i].InputColumnNamesArray[j], NgramHashingEstimator.ExpectedColumnType, columnType.ToString()); 256Host.CheckValue(ctx, nameof(ctx)); 266TextModelHelper.SaveAll(Host, ctx, _columns.Length, _slotNames); 280Host.CheckValue(ctx, nameof(ctx)); 284Host.CheckDecode(cbFloat == sizeof(float)); 328TextModelHelper.LoadAll(Host, ctx, columnsLength, out _slotNames, out _slotNamesTypes); 383base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), inputSchema, parent) 675throw _parent.Host.ExceptSchemaMismatch(nameof(inputSchema), "input", srcName);
Text\NgramTransform.cs (5)
204throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, NgramExtractingEstimator.ExpectedColumnType, type.ToString()); 218_ngramMaps = Train(Host, columns, _transformInfos, input, out _invDocFreqs); 402Host.CheckDecode(_invDocFreqs[i][j] >= 0); 455Host.CheckValue(ctx, nameof(ctx)); 483: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Text\StopWordsRemovingTransformer.cs (24)
191throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, StopWordsRemovingEstimator.ExpectedColumnType, type.ToString()); 207Host.CheckValue(ctx, nameof(ctx)); 290using (var ch = Host.Start("Check resources")) 358: base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), inputSchema, parent) 781Host.CheckValue(ch, nameof(ch)); 799dataLoader = new BinaryLoader(Host, new BinaryLoader.Arguments(), fileSource); 803dataLoader = new TransposeLoader(Host, new TransposeLoader.Arguments(), fileSource); 820var textLoader = new TextLoader(Host, options: options, dataSample: fileSource); 827dataLoader = loader.CreateComponent(Host, fileSource); 834Host.AssertValue(ch); 931var ch = Host.Start("LoadStopWords"); 938Host.CheckValue(ctx, nameof(ctx)); 950Host.CheckValue(c, nameof(ctx)); 957Host.Assert(_stopWordsMap.Count > 0); 962Host.Assert(nstr.Id == id); 981Host.AssertValue(ctx); 983using (var ch = Host.Start("Deserialization")) 991Host.CheckValue(c, nameof(ctx)); 998Host.CheckDecode(cstr > 0); 1004Host.CheckDecode(nstr.Id == istr); 1008Host.CheckDecode(stopwords.Count == cstr); 1010Host.CheckDecode(stopwords.Get("") == null); 1013throw Host.ExceptDecode(); 1069: base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), parent, inputSchema)
Text\TextNormalizing.cs (3)
120throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, TextNormalizingEstimator.ExpectedColumnType, type.ToString()); 125Host.CheckValue(ctx, nameof(ctx)); 204: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Text\TokenizingByCharacters.cs (3)
124throw Host.ExceptParam(nameof(inputSchema), TokenizingByCharactersEstimator.ExpectedColumnType); 143Host.CheckValue(ctx, nameof(ctx)); 199: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Text\WordBagTransform.cs (3)
238Host.CheckValue(ctx, nameof(ctx)); 264return new Mapper(Host, schema, this); 269Host.CheckValue(ctx, nameof(ctx));
Text\WordEmbeddingsExtractor.cs (12)
204Host.CheckNonWhiteSpace(customModelFile, nameof(customModelFile)); 250Host.AssertValue(ctx); 261_modelFileNameWithPath = EnsureModelFile(Host, out _linesToSkip, (WordEmbeddingEstimator.PretrainedModelKind)_modelKind); 264Host.CheckNonWhiteSpace(_modelFileNameWithPath, nameof(_modelFileNameWithPath)); 287Host.CheckValue(ctx, nameof(ctx)); 305throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, "String", inputSchema[srcCol].Type.ToString()); 314: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema) 630using (var ch = Host.Start("Ensuring resources")) 647throw Host.Except($"Can't map model kind = {kind} to specific file, please refer to https://aka.ms/MLNetIssue for assistance"); 654throw Host.Except("Custom word embedding model file '{0}' could not be found for Word Embeddings transform.", _modelFileNameWithPath); 676using (var ch = Host.Start(LoaderSignature)) 677using (var pch = Host.StartProgressChannel("Building Vocabulary from Model File for Word Embeddings Transform"))
Text\WordTokenizing.cs (3)
126throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, WordTokenizingEstimator.ExpectedColumnType, type.ToString()); 152Host.CheckValue(ctx, nameof(ctx)); 209: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Microsoft.ML.Vision (32)
DnnRetrainTransform.cs (32)
188Host.CheckNonWhiteSpace(options.LabelColumn, nameof(options.LabelColumn)); 189Host.CheckNonWhiteSpace(options.OptimizationOperation, nameof(options.OptimizationOperation)); 191throw Host.ExceptParam(nameof(options.OptimizationOperation), $"Optimization operation '{options.OptimizationOperation}' does not exist in the model"); 193Host.CheckNonWhiteSpace(options.TensorFlowLabel, nameof(options.TensorFlowLabel)); 195throw Host.ExceptParam(nameof(options.TensorFlowLabel), $"'{options.TensorFlowLabel}' does not exist in the model"); 197Host.CheckNonWhiteSpace(options.SaveLocationOperation, nameof(options.SaveLocationOperation)); 199throw Host.ExceptParam(nameof(options.SaveLocationOperation), $"'{options.SaveLocationOperation}' does not exist in the model"); 201Host.CheckNonWhiteSpace(options.SaveOperation, nameof(options.SaveOperation)); 203throw Host.ExceptParam(nameof(options.SaveOperation), $"'{options.SaveOperation}' does not exist in the model"); 207Host.CheckNonWhiteSpace(options.LossOperation, nameof(options.LossOperation)); 209throw Host.ExceptParam(nameof(options.LossOperation), $"'{options.LossOperation}' does not exist in the model"); 214Host.CheckNonWhiteSpace(options.MetricOperation, nameof(options.MetricOperation)); 216throw Host.ExceptParam(nameof(options.MetricOperation), $"'{options.MetricOperation}' does not exist in the model"); 221Host.CheckNonWhiteSpace(options.LearningRateOperation, nameof(options.LearningRateOperation)); 223throw Host.ExceptParam(nameof(options.LearningRateOperation), $"'{options.LearningRateOperation}' does not exist in the model"); 230throw Host.Except($"Column {columnName} doesn't exist"); 269throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", columnName, expectedType.ToString(), type.ToString()); 337using (var ch = Host.Start("Training TensorFlow model...")) 338using (var pch = Host.StartProgressChannel("TensorFlow training progress...")) 454DeleteFolderWithRetries(Host, tmpParamDir[0]); 458throw Host.ExceptIO(e, "Error serializing TensorFlow retrained model to disk."); 527Host.CheckValue(session, nameof(session)); 528Host.CheckNonEmpty(inputColumnNames, nameof(inputColumnNames)); 529Host.CheckNonEmpty(outputColumnNames, nameof(outputColumnNames)); 546(_tfOutputTypes, _outputTypes, _tfOutputOperations) = GetOutputInfo(Host, _session, _outputs); 548(_tfInputTypes, _tfInputShapes, _tfInputOperations) = GetInputInfo(Host, _session, _inputs.Select(x => _idvToTfMapping[x]).ToArray(), batchSize); 672Host.AssertValue(ctx); 690Host.AssertNonEmpty(_inputs); 695Host.AssertNonEmpty(_outputs); 722Host.Assert(actualWritten == fileLength); 750DeleteFolderWithRetries(Host, _modelLocation); 766base(Contracts.CheckRef(parent, nameof(parent)).Host.Register(nameof(Mapper)), inputSchema, parent)