convlab2.dst.sumbt package¶
Subpackages¶
Submodules¶
convlab2.dst.sumbt.BeliefTrackerSlotQueryMultiSlot module¶
-
class
convlab2.dst.sumbt.BeliefTrackerSlotQueryMultiSlot.
BeliefTracker
(args, num_labels, device='cuda')¶ Bases:
torch.nn.modules.module.Module
-
forward
(input_ids, input_len, labels, n_gpu=1, target_slot=None)¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
static
init_parameter
(module)¶
-
initialize_slot_value_lookup
(label_ids, slot_ids)¶
-
-
class
convlab2.dst.sumbt.BeliefTrackerSlotQueryMultiSlot.
BertForUtteranceEncoding
(config)¶ Bases:
transformers.modeling_bert.BertPreTrainedModel
-
forward
(input_ids, token_type_ids, attention_mask, output_all_encoded_layers=False)¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
-
class
convlab2.dst.sumbt.BeliefTrackerSlotQueryMultiSlot.
MultiHeadAttention
(heads, d_model, dropout=0.1)¶ Bases:
torch.nn.modules.module.Module
-
attention
(q, k, v, d_k, mask=None, dropout=None)¶
-
forward
(q, k, v, mask=None)¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
get_scores
()¶
-