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