1 write to Host
Microsoft.ML.TorchSharp (1)
TorchSharpBaseTrainer.cs (1)
89Host = Contracts.CheckRef(env, nameof(env)).Register(nameof(TorchSharpBaseTrainer));
20 references to Host
Microsoft.ML.TorchSharp (20)
NasBert\NasBertTrainer.cs (11)
319Host.CheckValue(inputSchema, nameof(inputSchema)); 366throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence", BertOptions.Sentence1ColumnName); 368throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence", BertOptions.Sentence1ColumnName, 372throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName); 377throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName, 384throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName); 386throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName, 393throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName, 399throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label", Option.LabelColumnName, 403throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName); 405throw Host.ExceptSchemaMismatch(nameof(inputSchema), "sentence2", BertOptions.Sentence2ColumnName,
TorchSharpBaseTrainer.cs (9)
103using (var ch = Host.Start("TrainModel")) 104using (var pch = Host.StartProgressChannel("Training model")) 112Host.CheckAlive(); 113trainer.Train(Host, input); 120transformer = CreateTransformer(Host, Option, trainer.Model, new DataViewSchema.DetachedColumn(labelCol.Value)); 159Device = TorchUtils.InitializeDevice(Parent.Host); 171var destDir = Path.Combine(((IHostEnvironmentInternal)Parent.Host).TempFilePath, "mlnet"); 179using (var ch = (Parent.Host as IHostEnvironment).Start("Ensuring model file is present.")) 181var ensureModel = ResourceManagerUtils.Instance.EnsureResourceAsync(Parent.Host, ch, modelUrl, destFileName, destDir, timeout);