Save SpatialDDLS
and DeconvDLModel
objects as RDS files. keras models cannot be stored natively as R
objects (e.g. RData or RDS files). By saving the architecture as a JSON-like
character object and the weights as a list, it is possible to retrieve a
functional model and make new predictions. If the trained.model
slot
is empty, the function will behave as usual. Note: with this option,
the state of optimizer is not saved, only model's architecture and weights.
It is possible to save the entire model as an HDF5 file with the
saveTrainedModelAsH5
function and load it into a
SpatialDDLS
object with the
loadTrainedModelFromH5
function. See documentation for details.
Usage
saveRDS(
object,
file,
ascii = FALSE,
version = NULL,
compress = TRUE,
refhook = NULL
)
# S4 method for DeconvDLModel
saveRDS(
object,
file,
ascii = FALSE,
version = NULL,
compress = TRUE,
refhook = NULL
)
# S4 method for SpatialDDLS
saveRDS(
object,
file,
ascii = FALSE,
version = NULL,
compress = TRUE,
refhook = NULL
)
Arguments
- object
SpatialDDLS
orDeconvDLModel
object to be saved- file
File path where the object will be saved
- ascii
a logical. If
TRUE
orNA
, an ASCII representation is written; otherwise (default), a binary one is used. See the comments in the help forsave
.- version
the workspace format version to use.
NULL
specifies the current default version (3). The only other supported value is 2, the default from R 1.4.0 to R 3.5.0.- compress
a logical specifying whether saving to a named file is to use
"gzip"
compression, or one of"gzip"
,"bzip2"
or"xz"
to indicate the type of compression to be used. Ignored iffile
is a connection.- refhook
a hook function for handling reference objects.
Value
No return value, saves a SpatialDDLS
object as
an RDS file on disk.