30 references to Parent
Microsoft.ML.TorchSharp (30)
NasBert\NasBertTrainer.cs (20)
507
if (inputSchema.TryGetColumnIndex(
Parent
.BertOptions.Sentence1ColumnName, out var col))
510
if (
Parent
.BertOptions.Sentence2ColumnName != default ||
Parent
.BertOptions.TaskType == BertTaskType.SentenceRegression)
511
if (inputSchema.TryGetColumnIndex(
Parent
.BertOptions.Sentence2ColumnName, out col))
517
if (
Parent
.BertOptions.TaskType == BertTaskType.TextClassification)
520
var keyType =
Parent
.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
521
var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType,
Parent
.LabelColumn);
534
info[0] = new DataViewSchema.DetachedColumn(
Parent
.Options.PredictionColumnName, new KeyDataViewType(typeof(uint),
Parent
.Options.NumberOfClasses), labelBuilder.ToAnnotations());
536
info[1] = new DataViewSchema.DetachedColumn(
Parent
.Options.ScoreColumnName, new VectorDataViewType(NumberDataViewType.Single,
Parent
.Options.NumberOfClasses), meta.ToAnnotations());
539
else if (
Parent
.BertOptions.TaskType == BertTaskType.NamedEntityRecognition)
542
var keyType =
Parent
.LabelColumn.Annotations.Schema.GetColumnOrNull(AnnotationUtils.Kinds.KeyValues)?.Type as VectorDataViewType;
543
var getter = Microsoft.ML.Internal.Utilities.Utils.MarshalInvoke(_makeLabelAnnotationGetter, this, keyType.ItemType.RawType,
Parent
.LabelColumn);
548
info[0] = new DataViewSchema.DetachedColumn(
Parent
.Options.PredictionColumnName, new VectorDataViewType(new KeyDataViewType(typeof(uint),
Parent
.Options.NumberOfClasses - 1)), labelBuilder.ToAnnotations());
556
info[0] = new DataViewSchema.DetachedColumn(
Parent
.Options.ScoreColumnName, NumberDataViewType.Single);
604
var inputTensor = torch.tensor(tokens, device:
Parent
.Device);
608
return (
Parent
.Model as NasBertModel).forward(inputTensor);
624
private protected override void SaveModel(ModelSaveContext ctx) =>
Parent
.SaveModel(ctx);
NasBert\NerTrainer.cs (1)
419
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
NasBert\SentenceSimilarityTrainer.cs (2)
276
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
277
getSentence2 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn2.Name]);
NasBert\TextClassificationTrainer.cs (7)
322
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
323
if (
Parent
.SentenceColumn2.IsValid)
324
getSentence2 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn2.Name]);
332
var editor = VBufferEditor.Create(ref dst,
Parent
.Options.NumberOfClasses);
353
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
354
if (
Parent
.SentenceColumn2.IsValid)
355
getSentence2 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn2.Name]);