matchzoo.models.mvlstm
¶
An implementation of MVLSTM Model.
Module Contents¶
-
class
matchzoo.models.mvlstm.
MVLSTM
¶ Bases:
matchzoo.engine.base_model.BaseModel
MVLSTM Model.
Examples
>>> model = MVLSTM() >>> model.params['hidden_size'] = 32 >>> model.params['top_k'] = 50 >>> model.params['mlp_num_layers'] = 2 >>> model.params['mlp_num_units'] = 20 >>> model.params['mlp_num_fan_out'] = 10 >>> model.params['mlp_activation_func'] = 'relu' >>> model.params['dropout_rate'] = 0.0 >>> model.guess_and_fill_missing_params(verbose=0) >>> model.build()
-
classmethod
get_default_params
(cls)¶ Returns: model default parameters.
-
classmethod
get_default_padding_callback
(cls, fixed_length_left: int = 10, fixed_length_right: int = 40, pad_word_value: typing.Union[int, str] = 0, pad_word_mode: str = 'pre', with_ngram: bool = False, fixed_ngram_length: int = None, pad_ngram_value: typing.Union[int, str] = 0, pad_ngram_mode: str = 'pre')¶ Model default padding callback.
The padding callback’s on_batch_unpacked would pad a batch of data to a fixed length.
Returns: Default padding callback.
-
build
(self)¶ Build model structure.
-
forward
(self, inputs)¶ Forward.
-
classmethod