transfer: Transfer

Description Usage Arguments Details Value Functions Examples

Description

Copy, convert or load your network.

Usage

1
2
3
4
5

Arguments

brain

An object of class brain as returned by brain.

import

An object of class brain_export as returned by export.

Details

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.

Value

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.

Functions

Examples

 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)

brain-r/brain documentation built on May 21, 2019, 4:05 a.m.