View source: R/2-layers-DeepTRIAGE.R
This function applies a variant of the DeepTRIAGE attention mechanism to the incoming layer (see DOI:10.1101/533406). This implementation differs slightly from the publication in that all layers have the same activation function and the random embedding weights are optionally learnable.
1 2 3 4 5 6 7 8 9 10 | layer_to_dense_DeepTRIAGE(
object,
result_dim,
embed_dim = result_dim * 4,
random_embedding = FALSE,
hidden_dim = 32,
hidden_activation = "tanh",
hidden_dropout = 0.5,
name = NULL
)
|
object |
A |
result_dim |
An integer. The size of the final layer. |
embed_dim |
An integer. The size of the final embedding matrix will equal the input dimension times the embedding dimension. |
random_embedding |
A boolean. Toggles whether to freeze the embedding matrix with random values. Otherwise, the embedding matrix is trainable. |
hidden_dim |
An integer. The size of the hidden layers. |
hidden_activation |
A string. The activation for the hidden layers. |
hidden_dropout |
A numeric. The dropout for the hidden layers. |
name |
A string. The prefix label for all layers. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.