| get_custom_objects | R Documentation |
Custom objects set using custom_object_scope() are not added to the
global list of custom objects, and will not appear in the returned
list.
get_custom_objects()
set_custom_objects(objects = named_list(), clear = TRUE)
objects |
A named list of custom objects, as returned by
|
clear |
bool, whether to clear the custom object registry before
populating it with |
An R named list mapping registered names to registered objects.
set_custom_objects() returns the registry values before updating, invisibly.
get_custom_objects()
You can use set_custom_objects() to restore a previous registry state.
# within a function, if you want to temporarily modify the registry,
function() {
orig_objects <- set_custom_objects(clear = TRUE)
on.exit(set_custom_objects(orig_objects))
## temporarily modify the global registry
# register_keras_serializable(....)
# .... <do work>
# on.exit(), the previous registry state is restored.
}
register_keras_serializable() is preferred over set_custom_objects() for
registering new objects.
Other serialization utilities:
deserialize_keras_object()
get_registered_name()
get_registered_object()
register_keras_serializable()
serialize_keras_object()
with_custom_object_scope()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.