| ag_linear | R Documentation |
Returns a closure-based layer. Because ag_param uses environment semantics, the optimizer updates W and b in-place, and forward() always uses the latest weights.
ag_linear(in_features, out_features, activation = NULL)
in_features |
Input dimension |
out_features |
Output dimension |
activation |
"relu", "sigmoid", "tanh", "softmax", or NULL |
List with W, b, forward(x), params()
layer <- ag_linear(4L, 8L, activation = "relu")
x <- ag_tensor(matrix(runif(4 * 16), 4, 16))
out <- layer$forward(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.