Description Usage Arguments Functions Cost functions See Also Examples
Train the brain.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | train(brain, cost, log = NULL, print = TRUE)
train_input(brain, ..., scale = FALSE, data = NULL)
train_output(brain, ..., scale = FALSE, data = NULL)
train_data(brain, data)
train_opts(brain, rate = NULL, iterations = NULL, error = NULL,
shuffle = NULL, cv = NULL)
cost_function(func)
get_training(brain)
get_log(brain)
|
brain |
An object of class |
cost |
A cost function as returned by |
log |
Frequency at which to log training error and elapsed time (iterations), can be retrieved with
|
print |
Whether to print training error, iterations and elapsed time. |
... |
Bare column names from |
scale |
Set to |
data |
A data.frame from where to select input and output ( |
rate |
Learning rate to train the network. It can be a static rate (just a number), dynamic (an list of numbers, which will transition from one to the next one according to the number of iterations). |
iterations |
Maximum number of iterations. |
error |
Minimum error. |
shuffle |
If |
cv |
Set to |
func |
Training cost function, one of |
train
: Train the brain.
train_data
: Add training data.
train_opts
: Pass training options.
train_input
, train_output
: Pass training input and output based on data
.
cost_function
: Returns a cost function to use as cost
in train
function.
get_training
: Returns training error, iterations and elapsed time.
mse
: Mean squared error
binary
: Binay
cross_entropy
: Cross Entropy
network
to manually create layers, connections and resulting brain, dsr
for
distracted sequence recall.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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("cross_entropy"),
log = 10
)
log <- get_log(br)
plot(log)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.