1 write to Host
Microsoft.ML.TorchSharp (1)
TorchSharpBaseTrainer.cs (1)
100
Host
= Contracts.CheckRef(env, nameof(env)).Register(nameof(TorchSharpBaseTrainer));
20 references to Host
Microsoft.ML.TorchSharp (20)
NasBert\NasBertTrainer.cs (11)
341
Host
.CheckValue(inputSchema, nameof(inputSchema));
388
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "sentence", BertOptions.Sentence1ColumnName);
390
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "sentence", BertOptions.Sentence1ColumnName,
394
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName);
399
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName,
406
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName);
408
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName,
415
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName,
421
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName,
425
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName);
427
throw
Host
.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName,
TorchSharpBaseTrainer.cs (9)
114
using (var ch =
Host
.Start("TrainModel"))
115
using (var pch =
Host
.StartProgressChannel("Training model"))
123
Host
.CheckAlive();
124
trainer.Train(
Host
, input);
131
transformer = CreateTransformer(
Host
, Option, trainer.Model, new DataViewSchema.DetachedColumn(labelCol.Value));
170
Device = TorchUtils.InitializeDevice(Parent.
Host
);
182
var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.
Host
).TempFilePath, "mlnet");
190
using (var ch = (Parent.
Host
as IHostEnvironment).Start("Ensuring model file is present."))
192
var ensureModel = ResourceManagerUtils.Instance.EnsureResourceAsync(Parent.
Host
, ch, modelUrl, destFileName, destDir, timeout);