save_load: Save and Load .rda Files with Conversion to Raw and Keras...

Description Usage Arguments Value Author(s) See Also Examples

Description

Save and load .rda files with conversion to objects of class raw (for saveGNN()) or "keras.engine.training.Model" (for loadGNN()).

Usage

1
2

Arguments

...

objects to be saved in file (under the provided names if name was provided). Those objects which are of class "gnn_GNN" are converted with as.raw() before they are saved.

file

file name; see the underlying save() and load().

name

character (vector) of name(s) under which the objects in ... are to be saved in file. If NULL, the names of the objects provided by ... are taken as name.

Value

saveGNN()

nothing (generates an .rda by side-effect).

loadGNN()

the loaded object(s). Those of class "gnn_GNN" are converted with as.keras() before they are returned; this also applies to a component of a loaded object of class list.

Author(s)

Marius Hofert

See Also

See the underlying functions load() and save() (among others).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if(TensorFlow_available()) { # rather restrictive (due to R-Forge, winbuilder)
library(gnn) # for being standalone

file <- tempfile("foo", fileext = ".rda")
GMMN1 <- FNN()
saveGNN(GMMN1, file = file) # converts GMMN via as.raw()
GMMN2 <- loadGNN(file) # converts loaded object via as.keras()
stopifnot(is.GNN(GMMN2), inherits(GMMN2[["model"]], "keras.engine.training.Model"))
rm(GMMN1, GMMN2) # clean-up
stopifnot(file.remove(file))

}

gnn documentation built on Sept. 20, 2021, 5:13 p.m.

Related to save_load in gnn...