tf.keras.layers.serialize
    
    
      
    
    
      
      Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
Serializes a Layer object into a JSON-compatible representation.
  View aliases
  
Compat aliases for migration
See
Migration guide for
more details.
`tf.compat.v1.keras.layers.serialize`
tf.keras.layers.serialize(
    layer, use_legacy_format=False
)
| Args | 
|---|
| layer | The Layerobject to serialize. | 
| Returns | 
|---|
| A JSON-serializable dict representing the object's config. | 
Example:
from pprint import pprint
model = tf.keras.models.Sequential()
model.add(tf.keras.Input(shape=(16,)))
model.add(tf.keras.layers.Dense(32, activation='relu'))
pprint(tf.keras.layers.serialize(model))
# prints the configuration of the model, as a dict.
  
  
 
  
    
    
      
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
  Last updated 2023-10-06 UTC.
  
  
  
    
      [null,null,["Last updated 2023-10-06 UTC."],[],[]]