Package keras

Implementation of the Keras API, the high-level API of TensorFlow.

Detailed documentation and user guides are available at keras.io.

Expand source code
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Implementation of the Keras API, the high-level API of TensorFlow.

Detailed documentation and user guides are available at
[keras.io](https://keras.io).
"""
# pylint: disable=unused-import
from tensorflow.python import tf2
from keras import distribute

# See b/110718070#comment18 for more details about this import.
from keras import models

from keras.engine.input_layer import Input
from keras.engine.sequential import Sequential
from keras.engine.training import Model

from tensorflow.python.util.tf_export import keras_export

__version__ = '2.6.0'

keras_export('keras.__version__').export_constant(__name__, '__version__')

Sub-modules

keras.activations

Built-in activation functions.

keras.api

Public API for tf. namespace.

keras.applications

Keras Applications are canned architectures with pre-trained weights.

keras.backend

Keras backend API.

keras.backend_config

Keras backend config API.

keras.callbacks

Callbacks: utilities called at certain points during model training.

keras.callbacks_v1

Callbacks: utilities called at certain points during model training.

keras.combinations

This module customizes test_combinations for tf.keras related tests.

keras.constraints

Constraints: functions that impose constraints on weight values.

keras.datasets

Small NumPy datasets for debugging/testing.

keras.distribute

Keras' Distribution Strategy library.

keras.engine
keras.estimator

Keras estimator API.

keras.feature_column
keras.initializers

Keras initializer serialization / deserialization.

keras.integration_test
keras.keras_parameterized

Utilities for unit-testing Keras.

keras.layers

Keras layers API.

keras.legacy_tf_layers
keras.losses

Built-in loss functions.

keras.metrics

Built-in metrics.

keras.mixed_precision

Keras mixed precision API …

keras.models

Code for model cloning, plus model-related API entries.

keras.optimizer_v1

Legacy v1 optimizer classes …

keras.optimizer_v2
keras.optimizers

Built-in optimizer classes …

keras.premade

Premade Model API.

keras.preprocessing

Provides keras data preprocessing utils to pre-process tf.data.Datasets before they are fed to the model.

keras.protobuf
keras.regularizers

Built-in regularizers.

keras.saving
keras.testing_utils

Utilities for unit-testing Keras.

keras.tests
keras.type
keras.utils
keras.wrappers