View source: R/attention-layers.R
The sequence is divided into blocks of length block_length. Attention for agiven query position can see all memory positions in the corresponding block and filter_width many positions to the left and right of the block. q Tensor [batch, heads, length, depth_k] k Tensor [batch, heads, length, depth_k] v Tensor [batch, heads, length, depth_v] Returns Tensor [batch, heads, length, depth_v]
1 2 3 4 5 6 7 8 | local_attention_1d(
q,
k,
v,
block_length = 128L,
filter_width = 100L,
name = NULL
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.