diff --git a/scripts/api_master.py b/scripts/api_master.py index 4b74d25d00..7b3b9a4f10 100644 --- a/scripts/api_master.py +++ b/scripts/api_master.py @@ -13,6 +13,7 @@ "title": "The Model class", "generate": [ "keras.Model", + "keras.KerasTensor", "keras.Model.summary", "keras.Model.get_layer", "keras.Model.get_quantization_layer_structure", @@ -41,6 +42,7 @@ "keras.Model.train_on_batch", "keras.Model.test_on_batch", "keras.Model.predict_on_batch", + "keras.callbacks.History", ], }, { @@ -161,7 +163,7 @@ "path": "base_layer", "title": "The base Layer class", "generate": [ - "keras.layers.Layer", + "keras.Layer", "keras.layers.Layer.weights", "keras.layers.Layer.trainable_weights", "keras.layers.Layer.non_trainable_weights", @@ -169,9 +171,10 @@ "keras.layers.Layer.trainable", "keras.layers.Layer.get_weights", "keras.layers.Layer.set_weights", - "keras.Model.get_config", + "keras.layers.Layer.get_config", "keras.layers.Layer.add_loss", "keras.layers.Layer.losses", + "keras.Variable", ], }, { @@ -186,6 +189,7 @@ "keras.activations.hard_shrink", "keras.activations.hard_sigmoid", "keras.activations.hard_silu", + "keras.activations.hard_swish", "keras.activations.hard_tanh", "keras.activations.leaky_relu", "keras.activations.linear", @@ -202,8 +206,10 @@ "keras.activations.softplus", "keras.activations.softsign", "keras.activations.sparse_plus", + "keras.activations.sparse_sigmoid", "keras.activations.sparsemax", "keras.activations.squareplus", + "keras.activations.swish", "keras.activations.tanh", "keras.activations.tanh_shrink", "keras.activations.threshold", @@ -213,6 +219,7 @@ "path": "initializers", "title": "Layer weight initializers", "generate": [ + "keras.Initializer", "keras.initializers.RandomNormal", "keras.initializers.RandomUniform", "keras.initializers.TruncatedNormal", @@ -245,7 +252,6 @@ "path": "constraints", "title": "Layer weight constraints", "generate": [ - "keras.constraints.Constraint", "keras.constraints.MaxNorm", "keras.constraints.MinMaxNorm", "keras.constraints.NonNeg", @@ -260,12 +266,16 @@ { "path": "input", "title": "Input object", - "generate": ["keras.Input"], + "generate": [ + "keras.Input", + ], }, { "path": "input_spec", "title": "InputSpec object", - "generate": ["keras.InputSpec"], + "generate": [ + "keras.InputSpec", + ], }, { "path": "dense", @@ -285,7 +295,10 @@ { "path": "embedding", "title": "Embedding layer", - "generate": ["keras.layers.Embedding"], + "generate": [ + "keras.layers.Embedding", + "keras.layers.ReversibleEmbedding", + ], }, { "path": "masking", @@ -312,17 +325,23 @@ { "path": "convolution1d", "title": "Conv1D layer", - "generate": ["keras.layers.Conv1D"], + "generate": [ + "keras.layers.Conv1D", + ], }, { "path": "convolution2d", "title": "Conv2D layer", - "generate": ["keras.layers.Conv2D"], + "generate": [ + "keras.layers.Conv2D", + ], }, { "path": "convolution3d", "title": "Conv3D layer", - "generate": ["keras.layers.Conv3D"], + "generate": [ + "keras.layers.Conv3D", + ], }, { "path": "separable_convolution1d", @@ -369,32 +388,44 @@ { "path": "max_pooling1d", "title": "MaxPooling1D layer", - "generate": ["keras.layers.MaxPooling1D"], + "generate": [ + "keras.layers.MaxPooling1D", + ], }, { "path": "max_pooling2d", "title": "MaxPooling2D layer", - "generate": ["keras.layers.MaxPooling2D"], + "generate": [ + "keras.layers.MaxPooling2D", + ], }, { "path": "max_pooling3d", "title": "MaxPooling3D layer", - "generate": ["keras.layers.MaxPooling3D"], + "generate": [ + "keras.layers.MaxPooling3D", + ], }, { "path": "average_pooling1d", "title": "AveragePooling1D layer", - "generate": ["keras.layers.AveragePooling1D"], + "generate": [ + "keras.layers.AveragePooling1D", + ], }, { "path": "average_pooling2d", "title": "AveragePooling2D layer", - "generate": ["keras.layers.AveragePooling2D"], + "generate": [ + "keras.layers.AveragePooling2D", + ], }, { "path": "average_pooling3d", "title": "AveragePooling3D layer", - "generate": ["keras.layers.AveragePooling3D"], + "generate": [ + "keras.layers.AveragePooling3D", + ], }, { "path": "global_max_pooling1d", @@ -1152,6 +1183,11 @@ "title": "SwapEMAWeights", "generate": ["keras.callbacks.SwapEMAWeights"], }, + # { + # "path": "orbax_checkpoint", + # "title": "OrbaxCheckpoint", + # "generate": ["keras.callbacks.OrbaxCheckpoint"], + # }, #Enable after 3.14 release. ], }, { @@ -1159,6 +1195,13 @@ "title": "Ops API", "toc": True, "children": [ + { + "path": "operation/", + "title": "The Operation class", + "generate": [ + "keras.Operation", + ], + }, { "path": "numpy/", "title": "NumPy ops", @@ -1363,6 +1406,7 @@ "keras.ops.batch_normalization", "keras.ops.binary_crossentropy", "keras.ops.categorical_crossentropy", + "keras.ops.celu", "keras.ops.conv", "keras.ops.conv_transpose", "keras.ops.ctc_decode", @@ -1371,7 +1415,12 @@ "keras.ops.dot_product_attention", "keras.ops.elu", "keras.ops.gelu", + "keras.ops.glu", "keras.ops.hard_sigmoid", + "keras.ops.hard_shrink", + "keras.ops.hard_silu", + "keras.ops.hard_swish", + "keras.ops.hard_tanh", "keras.ops.leaky_relu", "keras.ops.log_sigmoid", "keras.ops.log_softmax", @@ -1380,6 +1429,7 @@ "keras.ops.multi_hot", "keras.ops.normalize", "keras.ops.one_hot", + "keras.ops.polar", "keras.ops.psnr", "keras.ops.relu", "keras.ops.relu6", @@ -1387,23 +1437,19 @@ "keras.ops.separable_conv", "keras.ops.sigmoid", "keras.ops.silu", - "keras.ops.hard_silu", + "keras.ops.soft_shrink", "keras.ops.softmax", "keras.ops.softplus", "keras.ops.softsign", "keras.ops.sparse_categorical_crossentropy", - "keras.ops.swish", - "keras.ops.hard_swish", - "keras.ops.celu", + "keras.ops.sparse_plus", + "keras.ops.sparse_sigmoid", "keras.ops.sparsemax", "keras.ops.squareplus", - "keras.ops.sparse_plus", - "keras.ops.soft_shrink", - "keras.ops.threshold", - "keras.ops.glu", + "keras.ops.swish", "keras.ops.tanh_shrink", - "keras.ops.hard_tanh", - "keras.ops.hard_shrink", + "keras.ops.threshold", + "keras.ops.unfold", ], }, { @@ -1415,6 +1461,7 @@ "keras.ops.eig", "keras.ops.eigh", "keras.ops.inv", + "keras.ops.jvp", "keras.ops.logdet", "keras.ops.lstsq", "keras.ops.lu_factor", @@ -1468,6 +1515,7 @@ "generate": [ "keras.ops.image.affine_transform", "keras.ops.image.crop_images", + "keras.ops.image.elastic_transform", "keras.ops.image.extract_patches", "keras.ops.image.gaussian_blur", "keras.ops.image.hsv_to_rgb", @@ -1475,8 +1523,9 @@ "keras.ops.image.pad_images", "keras.ops.image.perspective_transform", "keras.ops.image.resize", - "keras.ops.image.rgb_to_hsv", "keras.ops.image.rgb_to_grayscale", + "keras.ops.image.rgb_to_hsv", + "keras.ops.image.scale_and_translate", ], }, { @@ -1485,10 +1534,26 @@ "generate": [ "keras.ops.fft", "keras.ops.fft2", - "keras.ops.rfft", - "keras.ops.stft", + "keras.ops.ifft2", "keras.ops.irfft", "keras.ops.istft", + "keras.ops.rfft", + "keras.ops.stft", + ], + }, + { + "path": "einops/", + "title": "Einops ops", + "generate": [ + "keras.ops.rearrange", + ], + }, + { + "path": "math/", + "title": "Math ops", + "generate": [ + "keras.ops.view_as_complex", + "keras.ops.view_as_real", ], }, ], @@ -1690,6 +1755,8 @@ "keras.metrics.SpecificityAtSensitivity", "keras.metrics.F1Score", "keras.metrics.FBetaScore", + "keras.metrics.PearsonCorrelation", + "keras.metrics.ConcordanceCorrelation", ], }, { @@ -1743,12 +1810,6 @@ "keras.losses.Poisson", "keras.losses.CTC", "keras.losses.KLDivergence", - "keras.losses.binary_crossentropy", - "keras.losses.categorical_crossentropy", - "keras.losses.sparse_categorical_crossentropy", - "keras.losses.poisson", - "keras.losses.ctc", - "keras.losses.kl_divergence", ], }, { @@ -1764,15 +1825,6 @@ "keras.losses.LogCosh", "keras.losses.Tversky", "keras.losses.Dice", - "keras.losses.mean_squared_error", - "keras.losses.mean_absolute_error", - "keras.losses.mean_absolute_percentage_error", - "keras.losses.mean_squared_logarithmic_error", - "keras.losses.cosine_similarity", - "keras.losses.huber", - "keras.losses.log_cosh", - "keras.losses.tversky", - "keras.losses.dice", ], }, { @@ -1782,9 +1834,9 @@ "keras.losses.Hinge", "keras.losses.SquaredHinge", "keras.losses.CategoricalHinge", - "keras.losses.hinge", - "keras.losses.squared_hinge", - "keras.losses.categorical_hinge", + "keras.losses.CategoricalGeneralizedCrossEntropy", + "keras.losses.Circle", + ], }, ], @@ -1829,6 +1881,31 @@ }, ], }, + { + "path": "tree/", + "title": "Tree API", + "toc": True, + "children": [ + { + "path": "tree_utilities", + "title": "Tree utilities", + "generate": [ + "keras.tree.MAP_TO_NONE", + "keras.tree.assert_same_paths", + "keras.tree.assert_same_structure", + "keras.tree.flatten", + "keras.tree.flatten_with_path", + "keras.tree.is_nested", + "keras.tree.lists_to_tuples", + "keras.tree.map_shape_structure", + "keras.tree.map_structure", + "keras.tree.map_structure_up_to", + "keras.tree.pack_sequence_as", + "keras.tree.traverse", + ], + }, + ], + }, { "path": "datasets/", "title": "Built-in small datasets", @@ -1863,6 +1940,7 @@ "generate": [ "keras.datasets.reuters.load_data", "keras.datasets.reuters.get_word_index", + "keras.datasets.reuters.get_label_names", ], }, { @@ -1875,6 +1953,11 @@ "title": "California Housing price regression dataset", "generate": ["keras.datasets.california_housing.load_data"], }, + { + "path": "boston_housing", + "title": "Boston Housing price regression dataset", + "generate": ["keras.datasets.boston_housing.load_data"], + }, ], }, { @@ -1884,107 +1967,279 @@ { "path": "xception", "title": "Xception", - "generate": ["keras.applications.Xception"], + "toc": True, + "children": [ + { + "path": "xception_model", + "title": "Xception model", + "generate": ["keras.applications.Xception"], + }, + { + "path": "xception_preprocessing", + "title": "Xception preprocessing utilities", + "generate": [ + "keras.applications.xception.decode_predictions", + "keras.applications.xception.preprocess_input", + ], + }, + ], }, { "path": "efficientnet", "title": "EfficientNet B0 to B7", - "generate": [ - "keras.applications.EfficientNetB0", - "keras.applications.EfficientNetB1", - "keras.applications.EfficientNetB2", - "keras.applications.EfficientNetB3", - "keras.applications.EfficientNetB4", - "keras.applications.EfficientNetB5", - "keras.applications.EfficientNetB6", - "keras.applications.EfficientNetB7", + "toc": True, + "children": [ + { + "path": "efficientnet_models", + "title": "EfficientNet models", + "generate": [ + "keras.applications.EfficientNetB0", + "keras.applications.EfficientNetB1", + "keras.applications.EfficientNetB2", + "keras.applications.EfficientNetB3", + "keras.applications.EfficientNetB4", + "keras.applications.EfficientNetB5", + "keras.applications.EfficientNetB6", + "keras.applications.EfficientNetB7", + ], + }, + { + "path": "efficientnet_preprocessing", + "title": "EfficientNet preprocessing utilities", + "generate": [ + "keras.applications.efficientnet.decode_predictions", + "keras.applications.efficientnet.preprocess_input", + ], + }, ], }, { "path": "efficientnet_v2", "title": "EfficientNetV2 B0 to B3 and S, M, L", - "generate": [ - "keras.applications.EfficientNetV2B0", - "keras.applications.EfficientNetV2B1", - "keras.applications.EfficientNetV2B2", - "keras.applications.EfficientNetV2B3", - "keras.applications.EfficientNetV2S", - "keras.applications.EfficientNetV2M", - "keras.applications.EfficientNetV2L", + "toc": True, + "children": [ + { + "path": "efficientnet_v2_models", + "title": "EfficientNetV2 models", + "generate": [ + "keras.applications.EfficientNetV2B0", + "keras.applications.EfficientNetV2B1", + "keras.applications.EfficientNetV2B2", + "keras.applications.EfficientNetV2B3", + "keras.applications.EfficientNetV2S", + "keras.applications.EfficientNetV2M", + "keras.applications.EfficientNetV2L", + ], + }, + { + "path": "efficientnet_v2_preprocessing", + "title": "EfficientNetV2 preprocessing utilities", + "generate": [ + "keras.applications.efficientnet_v2.decode_predictions", + "keras.applications.efficientnet_v2.preprocess_input", + ], + }, ], }, { "path": "convnext", "title": "ConvNeXt Tiny, Small, Base, Large, XLarge", - "generate": [ - "keras.applications.ConvNeXtTiny", - "keras.applications.ConvNeXtSmall", - "keras.applications.ConvNeXtBase", - "keras.applications.ConvNeXtLarge", - "keras.applications.ConvNeXtXLarge", + "toc": True, + "children": [ + { + "path": "convnext_models", + "title": "ConvNeXt models", + "generate": [ + "keras.applications.ConvNeXtTiny", + "keras.applications.ConvNeXtSmall", + "keras.applications.ConvNeXtBase", + "keras.applications.ConvNeXtLarge", + "keras.applications.ConvNeXtXLarge", + ], + }, + { + "path": "convnext_preprocessing", + "title": "ConvNeXt preprocessing utilities", + "generate": [ + "keras.applications.convnext.decode_predictions", + "keras.applications.convnext.preprocess_input", + ], + }, ], }, { "path": "vgg", "title": "VGG16 and VGG19", - "generate": [ - "keras.applications.VGG16", - "keras.applications.VGG19", + "toc": True, + "children": [ + { + "path": "vgg_models", + "title": "VGG16 and VGG19 models", + "generate": [ + "keras.applications.VGG16", + "keras.applications.VGG19", + ], + }, + { + "path": "vgg_preprocessing", + "title": "VGG preprocessing utilities", + "generate": [ + "keras.applications.vgg16.decode_predictions", + "keras.applications.vgg16.preprocess_input", + "keras.applications.vgg19.decode_predictions", + "keras.applications.vgg19.preprocess_input", + ], + }, ], }, { "path": "resnet", "title": "ResNet and ResNetV2", - "generate": [ - "keras.applications.ResNet50", - "keras.applications.ResNet101", - "keras.applications.ResNet152", - "keras.applications.ResNet50V2", - "keras.applications.ResNet101V2", - "keras.applications.ResNet152V2", + "toc": True, + "children": [ + { + "path": "resnet_models", + "title": "ResNet models", + "generate": [ + "keras.applications.ResNet50", + "keras.applications.ResNet101", + "keras.applications.ResNet152", + "keras.applications.ResNet50V2", + "keras.applications.ResNet101V2", + "keras.applications.ResNet152V2", + ], + }, + { + "path": "resnet_preprocessing", + "title": "ResNet preprocessing utilities", + "generate": [ + "keras.applications.resnet_v2.decode_predictions", + "keras.applications.resnet_v2.preprocess_input", + ], + }, ], }, { "path": "mobilenet", "title": "MobileNet, MobileNetV2, and MobileNetV3", - "generate": [ - "keras.applications.MobileNet", - "keras.applications.MobileNetV2", - "keras.applications.MobileNetV3Small", - "keras.applications.MobileNetV3Large", + "toc": True, + "children": [ + { + "path": "mobilenet_models", + "title": "MobileNet models", + "generate": [ + "keras.applications.MobileNet", + "keras.applications.MobileNetV2", + "keras.applications.MobileNetV3Small", + "keras.applications.MobileNetV3Large", + ], + }, + { + "path": "mobilenet_preprocessing", + "title": "MobileNet preprocessing utilities", + "generate": [ + "keras.applications.mobilenet.decode_predictions", + "keras.applications.mobilenet.preprocess_input", + "keras.applications.mobilenet_v2.decode_predictions", + "keras.applications.mobilenet_v2.preprocess_input", + "keras.applications.mobilenet_v3.decode_predictions", + "keras.applications.mobilenet_v3.preprocess_input", + ], + }, ], }, { "path": "densenet", "title": "DenseNet", - "generate": [ - "keras.applications.DenseNet121", - "keras.applications.DenseNet169", - "keras.applications.DenseNet201", + "toc": True, + "children": [ + { + "path": "densenet_models", + "title": "DenseNet models", + "generate": [ + "keras.applications.DenseNet121", + "keras.applications.DenseNet169", + "keras.applications.DenseNet201", + ], + }, + { + "path": "densenet_preprocessing", + "title": "DenseNet preprocessing utilities", + "generate": [ + "keras.applications.densenet.decode_predictions", + "keras.applications.densenet.preprocess_input", + ], + }, ], }, { "path": "nasnet", "title": "NasNetLarge and NasNetMobile", - "generate": [ - "keras.applications.NASNetLarge", - "keras.applications.NASNetMobile", + "toc": True, + "children": [ + { + "path": "nasnet_models", + "title": "NASNet models", + "generate": [ + "keras.applications.NASNetLarge", + "keras.applications.NASNetMobile", + ], + }, + { + "path": "nasnet_preprocessing", + "title": "NASNet preprocessing utilities", + "generate": [ + "keras.applications.nasnet.decode_predictions", + "keras.applications.nasnet.preprocess_input", + ], + }, ], }, { "path": "inceptionv3", "title": "InceptionV3", - "generate": [ - "keras.applications.InceptionV3", + "toc": True, + "children": [ + { + "path": "inception_v3_model", + "title": "InceptionV3 model", + "generate": [ + "keras.applications.InceptionV3", + ], + }, + { + "path": "inception_v3_preprocessing", + "title": "InceptionV3 preprocessing utilities", + "generate": [ + "keras.applications.inception_v3.decode_predictions", + "keras.applications.inception_v3.preprocess_input", + ], + }, ], }, { "path": "inceptionresnetv2", "title": "InceptionResNetV2", - "generate": [ - "keras.applications.InceptionResNetV2", + "toc": True, + "children": [ + { + "path": "inception_resnet_v2_model", + "title": "InceptionResNetV2 model", + "generate": [ + "keras.applications.InceptionResNetV2", + ], + }, + { + "path": "inception_resnet_v2_preprocessing", + "title": "InceptionResNetV2 preprocessing utilities", + "generate": [ + "keras.applications.inception_resnet_v2.decode_predictions", + "keras.applications.inception_resnet_v2.preprocess_input", + ], + }, ], }, + ], }, { @@ -2001,8 +2256,10 @@ "keras.dtype_policies.FloatDTypePolicy", "keras.dtype_policies.QuantizedDTypePolicy", "keras.dtype_policies.QuantizedFloat8DTypePolicy", + "keras.dtype_policies.GPTQDTypePolicy", "keras.config.dtype_policy", "keras.config.set_dtype_policy", + ], }, ], @@ -2082,7 +2339,7 @@ "title": "Quantizers", "toc": True, "generate": [ - "keras.quantizers.Quantizer", + "keras.Quantizer", ], "children": [ { @@ -2093,6 +2350,8 @@ "keras.quantizers.AbsMaxQuantizer", "keras.quantizers.QuantizationConfig", "keras.quantizers.Int8QuantizationConfig", + "keras.quantizers.Int4QuantizationConfig", + "keras.quantizers.Float8QuantizationConfig", "keras.quantizers.GPTQConfig", ], }, @@ -2103,12 +2362,9 @@ "keras.quantizers.abs_max_quantize", "keras.quantizers.compute_float8_amax_history", "keras.quantizers.compute_float8_scale", - "keras.quantizers.deserialize", "keras.quantizers.fake_quant_with_min_max_vars", - "keras.quantizers.get", "keras.quantizers.pack_int4", "keras.quantizers.quantize_and_dequantize", - "keras.quantizers.serialize", "keras.quantizers.unpack_int4", ], }, @@ -2127,6 +2383,14 @@ "keras.StatelessScope", ], }, + { + "path": "context_managers", + "title": "Context Managers", + "generate": [ + "keras.device", + "keras.name_scope", + ], + }, ], }, { @@ -2206,13 +2470,57 @@ "keras.utils.set_random_seed", "keras.utils.split_dataset", "keras.utils.pack_x_y_sample_weight", + "keras.utils.unpack_x_y_sample_weight", "keras.utils.get_file", "keras.utils.Progbar", - "keras.utils.PyDataset", "keras.utils.to_categorical", "keras.utils.normalize", ], }, + { + "path": "bounding_boxes_utils", + "title": "Bounding boxes utilities", + "generate": [ + "keras.utils.bounding_boxes.affine_transform", + "keras.utils.bounding_boxes.clip_to_image_size", + "keras.utils.bounding_boxes.compute_ciou", + "keras.utils.bounding_boxes.compute_iou", + "keras.utils.bounding_boxes.convert_format", + "keras.utils.bounding_boxes.crop", + "keras.utils.bounding_boxes.decode_deltas_to_boxes", + "keras.utils.bounding_boxes.encode_box_to_deltas", + "keras.utils.bounding_boxes.pad", + ], + }, + { + "path": "visualization_utils", + "title": "Visualization utilities", + "generate": [ + "keras.visualization.draw_bounding_boxes", + "keras.visualization.draw_segmentation_masks", + "keras.visualization.plot_bounding_box_gallery", + "keras.visualization.plot_image_gallery", + "keras.visualization.plot_segmentation_mask_gallery", + ], + }, + { + "path": "preprocessing_utils", + "title": "Preprocessing utilities", + "generate": [ + "keras.preprocessing.image.smart_resize", + "keras.preprocessing.image.load_img", + "keras.preprocessing.image.save_img", + "keras.utils.PyDataset", + ], + }, + { + "path": "backend_utils", + "title": "Backend utilities", + "generate": [ + "keras.backend.get_uid", + "keras.backend.result_type", + ], + }, { "path": "sklearn_wrappers", "title": "Scikit-Learn API wrappers", @@ -2242,6 +2550,15 @@ "keras.config.epsilon", "keras.config.set_epsilon", "keras.config.backend", + "keras.config.set_backend", + "keras.config.enable_flash_attention", + "keras.config.disable_flash_attention", + "keras.config.is_flash_attention_enabled", + "keras.config.is_nnx_enabled", + "keras.config.max_epochs", + "keras.config.set_max_epochs", + "keras.config.max_steps_per_epoch", + "keras.config.set_max_steps_per_epoch", ], }, ], diff --git a/scripts/autogen.py b/scripts/autogen.py index b8d7daf8ad..40fe356a80 100644 --- a/scripts/autogen.py +++ b/scripts/autogen.py @@ -578,6 +578,7 @@ def make_md_source_for_entry(self, entry, path_stack, title_stack): generated_md = "" for element in generate: generated_md += self.docstring_printer.render(element) + if "{{autogenerated}}" not in template: raise RuntimeError( "Template found for %s but missing "