save_load_rda | R Documentation |
Save and load .rda
files with conversion to objects of class
raw
(for save_gnn()
) or "keras.engine.training.Model"
(for load_gnn()
).
save_gnn(..., file, name = NULL)
load_gnn(file)
... |
objects to be saved in |
file |
file name; see the underlying |
name |
|
nothing (generates an .rda
by side-effect).
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
.
Marius Hofert
See the underlying functions load()
and save()
(among others).
if(TensorFlow_available()) { # rather restrictive (due to R-Forge, winbuilder)
library(gnn) # for being standalone
file <- tempfile("foo", fileext = ".rda")
GMMN1 <- FNN()
save_gnn(GMMN1, file = file) # converts GMMN via as.raw()
GMMN2 <- load_gnn(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))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.