PairRepresentation.Config

Component: PairRepresentation

class PairRepresentation.Config[source]

Bases: RepresentationBase.Config

encode_relations

bool – if false, return the concatenation of the two representations; if true, also concatenate their pairwise absolute difference and pairwise elementwise product (à la arXiv:1705.02364). Default: true.

subrepresentation

SubRepresentation – the sub-representation used for the inputs. If subrepresentation_right is not given, then this representation is used for both inputs with tied weights.

subrepresentation_right

Optional[SubRepresentation] – the sub-representation used for the right input. Optional. If missing, subrepresentation is used with tied weights. Default: None.

All Attributes (including base classes)

load_path: Optional[str] = None
save_path: Optional[str] = None
freeze: bool = False
shared_module_key: Optional[str] = None
subrepresentation: Union[BiLSTMDocAttention.Config, DocNNRepresentation.Config] = BiLSTMDocAttention.Config()
subrepresentation_right: Union[BiLSTMDocAttention.Config, DocNNRepresentation.Config, NoneType] = None
encode_relations: bool = True

Default JSON

{
    "load_path": null,
    "save_path": null,
    "freeze": false,
    "shared_module_key": null,
    "subrepresentation": {
        "BiLSTMDocAttention": {
            "load_path": null,
            "save_path": null,
            "freeze": false,
            "shared_module_key": null,
            "dropout": 0.4,
            "lstm": {
                "load_path": null,
                "save_path": null,
                "freeze": false,
                "shared_module_key": null,
                "dropout": 0.4,
                "lstm_dim": 32,
                "num_layers": 1,
                "bidirectional": true
            },
            "pooling": {
                "SelfAttention": {
                    "attn_dimension": 64,
                    "dropout": 0.4
                }
            },
            "mlp_decoder": null
        }
    },
    "subrepresentation_right": null,
    "encode_relations": true
}