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)
277
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
278
getSentence2 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn2.Name]);
NasBert\TextClassificationTrainer.cs (7)
323
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
324
if (
Parent
.SentenceColumn2.IsValid)
325
getSentence2 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn2.Name]);
333
var editor = VBufferEditor.Create(ref dst,
Parent
.Options.NumberOfClasses);
354
getSentence1 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn.Name]);
355
if (
Parent
.SentenceColumn2.IsValid)
356
getSentence2 = input.GetGetter<ReadOnlyMemory<char>>(input.Schema[
Parent
.SentenceColumn2.Name]);