From 13bc2b3bb073d52d82d8dc704499db4e1ce6ff93 Mon Sep 17 00:00:00 2001 From: TimotheeMickus Date: Mon, 25 Sep 2023 11:18:54 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20175ac?= =?UTF-8?q?3ea9cc916abbb15cdfdb520b5924f5d68d3=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _modules/index.html | 7 +- _modules/mammoth/decoders/decoder.html | 241 ------ .../mammoth/decoders/transformer_decoder.html | 741 ------------------ _modules/mammoth/encoders/encoder.html | 278 ------- _modules/mammoth/encoders/mean_encoder.html | 262 ------- .../mammoth/encoders/transformer_encoder.html | 401 ---------- _modules/mammoth/translate/translator.html | 4 +- _sources/attention_bridges.md.txt | 11 +- attention_bridges.html | 2 +- genindex.html | 38 +- mammoth.modules.html | 201 +---- objects.inv | Bin 1764 -> 1681 bytes searchindex.js | 2 +- 13 files changed, 19 insertions(+), 2169 deletions(-) delete mode 100644 _modules/mammoth/decoders/decoder.html delete mode 100644 _modules/mammoth/decoders/transformer_decoder.html delete mode 100644 _modules/mammoth/encoders/encoder.html delete mode 100644 _modules/mammoth/encoders/mean_encoder.html delete mode 100644 _modules/mammoth/encoders/transformer_encoder.html diff --git a/_modules/index.html b/_modules/index.html index 93a12d72..9eb57444 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -173,12 +173,7 @@

All modules for which code is available

-

Decoders

-
-
-class mammoth.decoders.DecoderBase(attentional=True)[source]
-

Bases: torch.nn.modules.module.Module

-

Abstract class for decoders.

-
-
Parameters
-

attentional (bool) – The decoder returns non-empty attention.

-
-
-
-
-classmethod from_opt(opt, embeddings)[source]
-

Alternate constructor.

-

Subclasses should override this method.

-
- -
-

Attention

@@ -655,112 +560,12 @@

Architecture: Transformer -
-class mammoth.encoders.TransformerEncoder(num_layers, d_model, heads, d_ff, dropout, attention_dropout, embeddings, max_relative_positions, pos_ffn_activation_fn='relu', layer_norm_module=None)[source]
-

Bases: mammoth.encoders.encoder.EncoderBase

-

The Transformer encoder from “Attention is All You Need” -[VSP+17]

-
- graph BT - A[input] - B[multi-head self-attn] - C[feed forward] - O[output] - A --> B - B --> C - C --> O -
-
Parameters
-
    -
  • num_layers (int) – number of encoder layers

  • -
  • d_model (int) – size of the model

  • -
  • heads (int) – number of heads

  • -
  • d_ff (int) – size of the inner FF layer

  • -
  • dropout (float) – dropout parameters

  • -
  • embeddings (mammoth.modules.Embeddings) – embeddings to use, should have positional encodings

  • -
  • pos_ffn_activation_fn (ActivationFunction) – activation function choice for PositionwiseFeedForward layer

  • -
-
-
Returns
-

    -
  • embeddings (src_len, batch_size, model_dim)

  • -
  • memory_bank (src_len, batch_size, model_dim)

  • -
-

-
-
Return type
-

(torch.FloatTensor, torch.FloatTensor)

-
-
-
-
-forward(src, lengths=None, skip_embedding=False, mask=None)[source]
-

See EncoderBase.forward()

-
- -
-
-classmethod from_opt(opt, embeddings, is_on_top=False)[source]
-

Alternate constructor.

-
- -
- -
-
-class mammoth.decoders.TransformerDecoder(num_layers, d_model, heads, d_ff, copy_attn, self_attn_type, dropout, attention_dropout, embeddings, max_relative_positions, aan_useffn, full_context_alignment, alignment_layer, alignment_heads, pos_ffn_activation_fn='relu', layer_norm_module=None)[source]
-

Bases: mammoth.decoders.transformer_decoder.TransformerDecoderBase

-

The Transformer decoder from “Attention is All You Need”. -[VSP+17]

-
- graph BT - A[input] - B[multi-head self-attn] - BB[multi-head src-attn] - C[feed forward] - O[output] - A --> B - B --> BB - BB --> C - C --> O -
-
Parameters
-
    -
  • num_layers (int) – number of decoder layers.

  • -
  • d_model (int) – size of the model

  • -
  • heads (int) – number of heads

  • -
  • d_ff (int) – size of the inner FF layer

  • -
  • copy_attn (bool) – if using a separate copy attention

  • -
  • self_attn_type (str) – type of self-attention scaled-dot, average

  • -
  • dropout (float) – dropout in residual, self-attn(dot) and feed-forward

  • -
  • attention_dropout (float) – dropout in context_attn (and self-attn(avg))

  • -
  • embeddings (mammoth.modules.Embeddings) – embeddings to use, should have positional encodings

  • -
  • max_relative_positions (int) – Max distance between inputs in relative positions representations

  • -
  • aan_useffn (bool) – Turn on the FFN layer in the AAN decoder

  • -
  • full_context_alignment (bool) – whether enable an extra full context decoder forward for alignment

  • -
  • alignment_layer (int) – N° Layer to supervise with for alignment guiding

  • -
  • alignment_heads (int) –

      -
    1. of cross attention heads to use for alignment guiding

    2. -
    -

  • -
-
-
-
-
-forward(tgt, memory_bank=None, step=None, memory_lengths=None, tgt_pad_mask=None, skip_embedding=False, **kwargs)[source]
-

Decode, possibly stepwise.

-
- -
-
class mammoth.modules.MultiHeadedAttention(head_count, model_dim, dropout=0.1, max_relative_positions=0)[source]

Bases: torch.nn.modules.module.Module

Multi-Head Attention module from “Attention is All You Need” -[VSP+17].

+[VSP+17].

Similar to standard dot attention but uses multiple attention distributions simulataneously to select relevant items.

@@ -907,7 +712,7 @@

Copy Attentionclass mammoth.modules.CopyGenerator(input_size, output_size, pad_idx)[source]

Bases: torch.nn.modules.module.Module

An implementation of pointer-generator networks -[SLM17].

+[SLM17].

These networks consider copying words directly from the source sequence.

The copy generator is an extended version of the standard @@ -978,7 +783,7 @@

Structured AttentionImplementation of the matrix-tree theorem for computing marginals of non-projective dependency parsing. This attention layer is used in the paper “Learning Structured Text Representations” -[LL17].

+[LL17].

forward(input)[source]
diff --git a/objects.inv b/objects.inv index 8400203f5fcc1d16d811aba80db2db5852459bf2..5f67f66112eb021707aeb74de2e99feb3a6cb8db 100644 GIT binary patch delta 1556 zcmV+v2J89c4Ur9ykblG7J!)iYF)Fg;lVk|}>u+UYu!$kYHt>)D((Z3Rw5wfNPH2)S zI}0Y7atV5vuHHw28Z#UZll9chCgQi>hoeDKr46k6bQ}rTnPN>?7F2LXEi~gw6a!&` zhx^IB`_@Rg9iAXknY1LOnxZ_=rj_Jis`Qd-)|fdHV1f?|(0??B57vUTT**593);pY zL6jw#pq4LyP(N3zRUg14p=RC_`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