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