FCNN4R (version 0.6.2)

mlp_export_C: Export multilayer perceptron network to a C function

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

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

Run this code

# 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")

Run the code above in your browser using DataCamp Workspace