Description Usage Arguments Details Value Functions Examples
Copy, convert or load your network.
1 2 3 4 5 |
brain |
An object of class |
import |
An object of class |
Training a large network may take some time, these functions allows you to export the trained brain to later import it, avoiding having to re-train it.
copy
returns a copy of the brain, export
returns a list of class
brain_export
that can be imported by import
which returns a brain of class brain
,
just like brain
.
export
: Export the network to a list
.
import
: Import a pre-trained network.
copy
: Copy the current network.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | df <- dplyr::tibble(
x = c(0, 0, 1, 1),
y = c(0, 1, 0, 1),
z = c(0, 1, 1, 0)
)
br <- brain() %>%
perceptron(c(2,3,1)) %>%
train_data(df) %>%
train_input(x, y) %>%
train_output(z) %>%
train(
cost = cost_function("mse")
) %>%
export()
test_data <- dplyr::tibble(
x = c(0, 0),
y = c(0, 1)
)
import(br) %>%
activate_data(test_data) %>%
activate(x, y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.