Category: 14. Utilities

  • Keras configuration utilities

    version function clear_session function Resets all state generated by Keras. Keras manages a global state, which it uses to implement the Functional model-building API and to uniquify autogenerated layer names. If you are creating many models in a loop, this global state will consume an increasing amount of memory over time, and you may want to clear…

  • Python & NumPy utilities

    set_random_seed function Sets all random seeds (Python, NumPy, and backend framework, e.g. TF). You can use this utility to make almost any Keras program fully deterministic. Some limitations apply in cases where network communications are involved (e.g. parameter server distribution), which creates additional sources of randomness, or when certain non-deterministic cuDNN ops are involved. Calling this…

  • Tensor utilities

    get_source_inputs function Returns the list of input tensors necessary to compute tensor. Output will always be a list of tensors (potentially with 1 element). Arguments Returns List of input tensors. is_keras_tensor function Returns whether x is a Keras tensor. A “Keras tensor” is a symbolic tensor, such as a tensor that was created via Input(). A “symbolic tensor” can be understood as…

  • Structured data preprocessing utilities

    FeatureSpace class One-stop utility for preprocessing and encoding structured data. Arguments Available feature types: Note that all features can be referred to by their string name, e.g. “integer_categorical”. When using the string name, the default argument values are used. Examples Basic usage with a dict of input data: Basic usage with tf.data: Basic usage with the Keras Functional…

  • Model plotting utilities

    plot_model function Converts a Keras model to dot format and save to a file. Example Arguments Returns A Jupyter notebook Image object if Jupyter is installed. This enables in-line display of the model plots in notebooks. model_to_dot function Convert a Keras model to dot format. Arguments