1 write to Option
Microsoft.ML.TorchSharp (1)
TorchSharpBaseTrainer.cs (1)
94
Option
= options;
44 references to Option
Microsoft.ML.TorchSharp (44)
NasBert\NasBertTrainer.cs (24)
194
total_steps: ((TrainingRowCount / Parent.
Option
.BatchSize) + 1) * Parent.
Option
.MaxEpoch,
197
div_factor: 1.0 / Parent.
Option
.StartLearningRateRatio,
198
final_div_factor: Parent.
Option
.StartLearningRateRatio / Parent.
Option
.FinalLearningRateRatio);
208
model = new NerModel(Parent.BertOptions, tokenizerModel.PadIndex, tokenizerModel.SymbolsCount, Parent.
Option
.NumberOfClasses);
210
model = new ModelForPrediction(Parent.BertOptions, tokenizerModel.PadIndex, tokenizerModel.SymbolsCount, Parent.
Option
.NumberOfClasses);
219
return input.GetRowCursor(input.Schema[Parent.BertOptions.Sentence1ColumnName], input.Schema[Parent.BertOptions.Sentence2ColumnName], input.Schema[Parent.
Option
.LabelColumnName]);
221
return input.GetRowCursor(input.Schema[Parent.BertOptions.Sentence1ColumnName], input.Schema[Parent.
Option
.LabelColumnName]);
333
inputSchema.TryFindColumn(
Option
.LabelColumnName, out var labelCol);
335
outColumns[
Option
.PredictionColumnName] = new SchemaShape.Column(
Option
.PredictionColumnName, SchemaShape.Column.VectorKind.Scalar,
338
outColumns[
Option
.ScoreColumnName] = new SchemaShape.Column(
Option
.ScoreColumnName, SchemaShape.Column.VectorKind.Vector,
348
inputSchema.TryFindColumn(
Option
.LabelColumnName, out var labelCol);
350
outColumns[
Option
.PredictionColumnName] = new SchemaShape.Column(
Option
.PredictionColumnName, SchemaShape.Column.VectorKind.VariableVector,
355
outColumns[
Option
.ScoreColumnName] = new SchemaShape.Column(
Option
.ScoreColumnName, SchemaShape.Column.VectorKind.Scalar,
371
if (!inputSchema.TryFindColumn(
Option
.LabelColumnName, out var labelCol))
372
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label",
Option
.LabelColumnName);
377
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label",
Option
.LabelColumnName,
393
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label",
Option
.LabelColumnName,
399
throw Host.ExceptSchemaMismatch(nameof(inputSchema), "label",
Option
.LabelColumnName,
NasBert\NerTrainer.cs (3)
216
input.Schema[Parent.
Option
.LabelColumnName].GetKeyValues(ref keys);
217
var labelCol = input.GetColumn<VBuffer<uint>>(Parent.
Option
.LabelColumnName);
225
Parent.
Option
.NumberOfClasses = keys.Length + 1;
NasBert\SentenceSimilarityTrainer.cs (2)
148
var labelCol = input.GetColumn<float>(Parent.
Option
.LabelColumnName);
157
Parent.
Option
.NumberOfClasses = 1;
NasBert\TextClassificationTrainer.cs (2)
150
var labelCol = input.GetColumn<uint>(Parent.
Option
.LabelColumnName);
160
Parent.
Option
.NumberOfClasses = uniqueLabels.Count;
TorchSharpBaseTrainer.cs (13)
109
for (int i = 0; i <
Option
.MaxEpoch; i++)
115
if (
Option
.ValidationSet != null)
118
var labelCol = input.Schema.GetColumnOrNull(
Option
.LabelColumnName);
120
transformer = CreateTransformer(Host,
Option
, trainer.Model, new DataViewSchema.DetachedColumn(labelCol.Value));
197
var validationSet = Parent.
Option
.ValidationSet;
203
var labelGetter = cursor.GetGetter<TLabelCol>(validationSet.Schema[Parent.
Option
.LabelColumnName]);
206
List<Tensor> inputTensors = new List<Tensor>(Parent.
Option
.BatchSize);
207
List<TTargetsCol> targets = new List<TTargetsCol>(Parent.
Option
.BatchSize);
237
for (int i = 0; i < Parent.
Option
.BatchSize && cursorValid; i++)
275
var labelGetter = cursor.GetGetter<TLabelCol>(input.Schema[Parent.
Option
.LabelColumnName]);
278
List<Tensor> inputTensors = new List<Tensor>(Parent.
Option
.BatchSize);
279
List<TTargetsCol> targets = new List<TTargetsCol>(Parent.
Option
.BatchSize);
310
for (int i = 0; i < Parent.
Option
.BatchSize && cursorValid; i++)