matchzoo.models.match_pyramid

An implementation of MatchPyramid Model.

Module Contents

class matchzoo.models.match_pyramid.MatchPyramid

Bases: matchzoo.engine.base_model.BaseModel

MatchPyramid Model.

Examples

>>> model = MatchPyramid()
>>> model.params['embedding_output_dim'] = 300
>>> model.params['kernel_count'] = [16, 32]
>>> model.params['kernel_size'] = [[3, 3], [3, 3]]
>>> model.params['dpool_size'] = [3, 10]
>>> model.guess_and_fill_missing_params(verbose=0)
>>> model.build()
classmethod get_default_params(cls)
Returns:model default parameters.
build(self)

Build model structure.

MatchPyramid text matching as image recognition.

forward(self, inputs)

Forward.

classmethod _make_conv_pool_block(cls, in_channels: int, out_channels: int, kernel_size: tuple, activation: nn.Module)

Make conv pool block.