-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathclass_keras.R
41 lines (34 loc) · 979 Bytes
/
class_keras.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#' @export
store_class_format.keras <- function(format) {
store_class_format_keras
}
store_class_format_keras <- c("tar_keras", "tar_nonexportable", "tar_store")
#' @export
store_assert_format_setting.keras <- function(format) {
}
# It would be too burdensome to depend on Python Keras
# just for automated testing, so this code is covered
# in semi-automated tests in tests/hpc/ and # nolint
# tests/interactive/. # nolint
# nocov start
#' @export
store_read_path.tar_keras <- function(store, path) {
keras::load_model_hdf5(path)
}
#' @export
store_write_path.tar_keras <- function(store, object, path) {
keras::save_model_hdf5(object = object, filepath = path)
}
#' @export
store_marshal_object.tar_keras <- function(store, object) {
keras::serialize_model(object)
}
#' @export
store_unmarshal_object.tar_keras <- function(store, object) {
keras::unserialize_model(object)
}
# nocov end
#' @export
store_get_packages.tar_keras <- function(store) {
"keras"
}