matchzoo.models.arci
¶
An implementation of ArcI Model.
Module Contents¶
-
class
matchzoo.models.arci.
ArcI
¶ Bases:
matchzoo.engine.base_model.BaseModel
ArcI Model.
Examples
>>> model = ArcI() >>> model.params['left_filters'] = [32] >>> model.params['right_filters'] = [32] >>> model.params['left_kernel_sizes'] = [3] >>> model.params['right_kernel_sizes'] = [3] >>> model.params['left_pool_sizes'] = [2] >>> model.params['right_pool_sizes'] = [4] >>> model.params['conv_activation_func'] = 'relu' >>> model.params['mlp_num_layers'] = 1 >>> model.params['mlp_num_units'] = 64 >>> model.params['mlp_num_fan_out'] = 32 >>> model.params['mlp_activation_func'] = 'relu' >>> model.params['dropout_rate'] = 0.5 >>> 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 = 100, 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.
ArcI use Siamese arthitecture.
-
forward
(self, inputs)¶ Forward.
-
classmethod
_make_conv_pool_block
(cls, in_channels: int, out_channels: int, kernel_size: int, activation: nn.Module, pool_size: int)¶ Make conv pool block.
-
classmethod