Description Usage Arguments Examples
Create tensors.
1 | add_tensor(brain, values, name, shape = NULL, dtype = NULL)
|
brain |
An object of class |
name |
Name of tensor, used to refer and use the tensor further down the pipe. |
shape |
Shape of the tensor. |
dtype |
Data type, one of |
value |
The values of the tensor. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | IN <- c(0, 0, 0)
OUT <- c(1, 1, 1)
## Not run:
library(shiny)
ui <- fluidPage(brainyOutput("brainy"))
server <- function(input, output){
output$brainy <- renderBrainy({
brainy() %>%
layer_add(
layer_dense(units = 1)
) %>%
model_compile(
optimizer = "meanSquaredError",
loss = "sgd"
) %>%
add_tensor(
values = IN,
name = "input"
) %>%
add_tensor(
values = OUT,
name = "output"
)
})
}
shinyApp(ui, server)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.