| ag_sequential | R Documentation |
Chains layers so that forward(x) passes x through each layer
in order. parameters() collects all trainable params from all layers.
ag_train() / ag_eval() propagate mode to stateful sub-layers.
ag_sequential(...)
... |
Layer objects (ag_linear, ag_dropout, ag_batch_norm, ag_embedding) or a single list of layers. |
An ag_sequential environment
model <- ag_sequential(
ag_linear(4L, 16L, activation = "relu"),
ag_dropout(0.5),
ag_linear(16L, 2L, activation = "softmax")
)
x <- ag_tensor(matrix(runif(4 * 8), 4, 8))
out <- model$forward(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.