mlp_export_C: Export multilayer perceptron network to a C function

Description Usage Arguments Value Examples

View source: R/mlp_net.R

Description

This function exports multilayer perceptron network to a C function with optional affine input and output transformations: Ax+b for inputs and Cx+d for outputs.

Usage

1
2
mlp_export_C(fname, net, with_bp = FALSE, A = NULL, b = NULL, C = NULL,
  d = NULL)

Arguments

fname

character string with the filename

net

an object of mlp_net class

with_bp

logical, should backpropagation code for online learning be exported?

A

numeric matrix (optional), input linear transformation

b

numeric vector (optional), input translation

C

numeric matrix (optional), output linear transformation

d

numeric vector (optional), output translation

Value

Logical value, TRUE if export was successful, FALSE otherwise.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# create a 2-3-1 network
net <- mlp_net(c(2, 3, 1))
# randomise weights
net <- mlp_rnd_weights(net)
# show the network
show(net)
# export network to a C function
mlp_export_C("test.c", net)
# show the output file
file.show("test.c")

FCNN4R documentation built on May 29, 2017, 4:26 p.m.