Serialize a Keras object into a JSON-compatible representation.

Calls to serialize_keras_object while underneath the SharedObjectSavingScope context manager will cause any objects re-used across multiple layers to be saved with a special shared object ID. This allows the network to be re-created properly during deserialization.

instance The object to serialize.

A dict-like, JSON-compatible representation of the object's config.