text
stringlengths
5
261k
id
stringlengths
16
106
metadata
dict
__index_level_0__
int64
0
266
<jupyter_start><jupyter_text>Data-efficient GANs with Adaptive Discriminator Augmentation**Author:** [AndrΓ‘s BΓ©res](https://www.linkedin.com/in/andras-beres-789190210)**Date created:** 2021/10/28**Last modified:** 2021/10/28**Description:** Generating images from limited data using the Caltech Birds dataset. Introduct...
keras-io/examples/generative/ipynb/gan_ada.ipynb/0
{ "file_path": "keras-io/examples/generative/ipynb/gan_ada.ipynb", "repo_id": "keras-io", "token_count": 9009 }
100
# Drug Molecule Generation with VAE **Author:** [Victor Basu](https://www.linkedin.com/in/victor-basu-520958147)<br> **Date created:** 2022/03/10<br> **Last modified:** 2022/03/24<br> **Description:** Implementing a Convolutional Variational AutoEncoder (VAE) for Drug Discovery. <img class="k-inline-icon" src="https...
keras-io/examples/generative/md/molecule_generation.md/0
{ "file_path": "keras-io/examples/generative/md/molecule_generation.md", "repo_id": "keras-io", "token_count": 10447 }
101
""" Title: A walk through latent space with Stable Diffusion Authors: Ian Stenbit, [fchollet](https://twitter.com/fchollet), [lukewood](https://twitter.com/luke_wood_ml) Date created: 2022/09/28 Last modified: 2022/09/28 Description: Explore the latent manifold of Stable Diffusion. Accelerator: GPU """ """ ## Overview...
keras-io/examples/generative/random_walks_with_stable_diffusion.py/0
{ "file_path": "keras-io/examples/generative/random_walks_with_stable_diffusion.py", "repo_id": "keras-io", "token_count": 4341 }
102
""" Title: Simple custom layer example: Antirectifier Author: [fchollet](https://twitter.com/fchollet) Date created: 2016/01/06 Last modified: 2023/11/20 Description: Demonstration of custom layer creation. Accelerator: GPU """ """ ## Introduction This example shows how to create custom layers, using the Antirectifie...
keras-io/examples/keras_recipes/antirectifier.py/0
{ "file_path": "keras-io/examples/keras_recipes/antirectifier.py", "repo_id": "keras-io", "token_count": 1295 }
103
<jupyter_start><jupyter_text>Endpoint layer pattern**Author:** [fchollet](https://twitter.com/fchollet)**Date created:** 2019/05/10**Last modified:** 2023/11/22**Description:** Demonstration of the "endpoint layer" pattern (layer that handles loss management). Setup<jupyter_code>import os os.environ["KERAS_BACKEND"] ...
keras-io/examples/keras_recipes/ipynb/endpoint_layer_pattern.ipynb/0
{ "file_path": "keras-io/examples/keras_recipes/ipynb/endpoint_layer_pattern.ipynb", "repo_id": "keras-io", "token_count": 1417 }
104
# Keras debugging tips **Author:** [fchollet](https://twitter.com/fchollet)<br> **Date created:** 2020/05/16<br> **Last modified:** 2023/11/16<br> **Description:** Four simple tips to help you debug your Keras code. <img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favicon.ico"/> [**View in...
keras-io/examples/keras_recipes/md/debugging_tips.md/0
{ "file_path": "keras-io/examples/keras_recipes/md/debugging_tips.md", "repo_id": "keras-io", "token_count": 16790 }
105
""" Title: Evaluating and exporting scikit-learn metrics in a Keras callback Author: [lukewood](https://lukewood.xyz) Date created: 10/07/2021 Last modified: 11/17/2023 Description: This example shows how to use Keras callbacks to evaluate and export non-TensorFlow based metrics. Accelerator: GPU """ """ ## Introducti...
keras-io/examples/keras_recipes/sklearn_metric_callbacks.py/0
{ "file_path": "keras-io/examples/keras_recipes/sklearn_metric_callbacks.py", "repo_id": "keras-io", "token_count": 1770 }
106
<jupyter_start><jupyter_text>Text Classification using FNet**Author:** [Abheesht Sharma](https://github.com/abheesht17/)**Date created:** 2022/06/01**Last modified:** 2022/12/21**Description:** Text Classification on the IMDb Dataset using `keras_nlp.layers.FNetEncoder` layer. IntroductionIn this example, we will demo...
keras-io/examples/nlp/ipynb/fnet_classification_with_keras_nlp.ipynb/0
{ "file_path": "keras-io/examples/nlp/ipynb/fnet_classification_with_keras_nlp.ipynb", "repo_id": "keras-io", "token_count": 4000 }
107
<jupyter_start><jupyter_text>Sentence embeddings using Siamese RoBERTa-networks**Author:** [Mohammed Abu El-Nasr](https://github.com/abuelnasr0)**Date created:** 2023/07/14**Last modified:** 2023/07/14**Description:** Fine-tune a RoBERTa model to generate sentence embeddings using KerasNLP. IntroductionBERT and RoBERT...
keras-io/examples/nlp/ipynb/sentence_embeddings_with_sbert.ipynb/0
{ "file_path": "keras-io/examples/nlp/ipynb/sentence_embeddings_with_sbert.ipynb", "repo_id": "keras-io", "token_count": 5392 }
108
# End-to-end Masked Language Modeling with BERT **Author:** [Ankur Singh](https://twitter.com/ankur310794)<br> **Date created:** 2020/09/18<br> **Last modified:** 2020/09/18<br> <img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favicon.ico"/> [**View in Colab**](https://colab.research.googl...
keras-io/examples/nlp/md/masked_language_modeling.md/0
{ "file_path": "keras-io/examples/nlp/md/masked_language_modeling.md", "repo_id": "keras-io", "token_count": 10033 }
109
""" Title: Semantic Similarity with BERT Author: [Mohamad Merchant](https://twitter.com/mohmadmerchant1) Date created: 2020/08/15 Last modified: 2020/08/29 Description: Natural Language Inference by fine-tuning BERT model on SNLI Corpus. Accelerator: GPU """ """ ## Introduction Semantic Similarity is the task of dete...
keras-io/examples/nlp/semantic_similarity_with_bert.py/0
{ "file_path": "keras-io/examples/nlp/semantic_similarity_with_bert.py", "repo_id": "keras-io", "token_count": 4576 }
110
<jupyter_start><jupyter_text>Proximal Policy Optimization**Author:** [Ilias Chrysovergis](https://twitter.com/iliachry)**Date created:** 2021/06/24**Last modified:** 2021/06/24**Description:** Implementation of a Proximal Policy Optimization agent for the CartPole-v0 environment. IntroductionThis code example solves t...
keras-io/examples/rl/ipynb/ppo_cartpole.ipynb/0
{ "file_path": "keras-io/examples/rl/ipynb/ppo_cartpole.ipynb", "repo_id": "keras-io", "token_count": 4283 }
111
<jupyter_start><jupyter_text>Structured data classification with FeatureSpace**Author:** [fchollet](https://twitter.com/fchollet)**Date created:** 2022/11/09**Last modified:** 2022/11/09**Description:** Classify tabular data in a few lines of code. IntroductionThis example demonstrates how to do structured data classi...
keras-io/examples/structured_data/ipynb/structured_data_classification_with_feature_space.ipynb/0
{ "file_path": "keras-io/examples/structured_data/ipynb/structured_data_classification_with_feature_space.ipynb", "repo_id": "keras-io", "token_count": 4374 }
112
""" Title: Structured data classification with FeatureSpace Author: [fchollet](https://twitter.com/fchollet) Date created: 2022/11/09 Last modified: 2022/11/09 Description: Classify tabular data in a few lines of code. Accelerator: GPU """ """ ## Introduction This example demonstrates how to do structured data classi...
keras-io/examples/structured_data/structured_data_classification_with_feature_space.py/0
{ "file_path": "keras-io/examples/structured_data/structured_data_classification_with_feature_space.py", "repo_id": "keras-io", "token_count": 4235 }
113
<jupyter_start><jupyter_text>Timeseries classification from scratch**Author:** [hfawaz](https://github.com/hfawaz/)**Date created:** 2020/07/21**Last modified:** 2023/11/10**Description:** Training a timeseries classifier from scratch on the FordA dataset from the UCR/UEA archive. IntroductionThis example shows how to...
keras-io/examples/timeseries/ipynb/timeseries_classification_from_scratch.ipynb/0
{ "file_path": "keras-io/examples/timeseries/ipynb/timeseries_classification_from_scratch.ipynb", "repo_id": "keras-io", "token_count": 2313 }
114
""" Title: 3D image classification from CT scans Author: [Hasib Zunair](https://twitter.com/hasibzunair) Date created: 2020/09/23 Last modified: 2024/01/11 Description: Train a 3D convolutional neural network to predict presence of pneumonia. Accelerator: GPU """ """ ## Introduction This example will show the steps n...
keras-io/examples/vision/3D_image_classification.py/0
{ "file_path": "keras-io/examples/vision/3D_image_classification.py", "repo_id": "keras-io", "token_count": 4987 }
115
""" Title: Monocular depth estimation Author: [Victor Basu](https://www.linkedin.com/in/victor-basu-520958147) Date created: 2021/08/30 Last modified: 2021/08/30 Description: Implement a depth estimation model with a convnet. Accelerator: GPU """ """ ## Introduction _Depth estimation_ is a crucial step towards inferr...
keras-io/examples/vision/depth_estimation.py/0
{ "file_path": "keras-io/examples/vision/depth_estimation.py", "repo_id": "keras-io", "token_count": 6609 }
116
<jupyter_start><jupyter_text>Next-Frame Video Prediction with Convolutional LSTMs**Author:** [Amogh Joshi](https://github.com/amogh7joshi)**Date created:** 2021/06/02**Last modified:** 2023/11/10**Description:** How to build and train a convolutional LSTM model for next-frame video prediction. IntroductionThe[Convolut...
keras-io/examples/vision/ipynb/conv_lstm.ipynb/0
{ "file_path": "keras-io/examples/vision/ipynb/conv_lstm.ipynb", "repo_id": "keras-io", "token_count": 3393 }
117
<jupyter_start><jupyter_text>Image classification via fine-tuning with EfficientNet**Author:** [Yixing Fu](https://github.com/yixingfu)**Date created:** 2020/06/30**Last modified:** 2023/07/10**Description:** Use EfficientNet with weights pre-trained on imagenet for Stanford Dogs classification. Introduction: what is ...
keras-io/examples/vision/ipynb/image_classification_efficientnet_fine_tuning.ipynb/0
{ "file_path": "keras-io/examples/vision/ipynb/image_classification_efficientnet_fine_tuning.ipynb", "repo_id": "keras-io", "token_count": 4574 }
118
<jupyter_start><jupyter_text>MobileViT: A mobile-friendly Transformer-based model for image classification**Author:** [Sayak Paul](https://twitter.com/RisingSayak)**Date created:** 2021/10/20**Last modified:** 2024/02/11**Description:** MobileViT for image classification with combined benefits of convolutions and Trans...
keras-io/examples/vision/ipynb/mobilevit.ipynb/0
{ "file_path": "keras-io/examples/vision/ipynb/mobilevit.ipynb", "repo_id": "keras-io", "token_count": 4890 }
119
<jupyter_start><jupyter_text>Semantic segmentation with SegFormer and Hugging Face Transformers**Author:** [Sayak Paul](https://twitter.com/RisingSayak)**Date created:** 2023/01/25**Last modified:** 2023/01/29**Description:** Fine-tuning a SegFormer model variant for semantic segmentation. IntroductionIn this example,...
keras-io/examples/vision/ipynb/segformer.ipynb/0
{ "file_path": "keras-io/examples/vision/ipynb/segformer.ipynb", "repo_id": "keras-io", "token_count": 3037 }
120
<jupyter_start><jupyter_text>Video Vision Transformer**Author:** [Aritra Roy Gosthipaty](https://twitter.com/ariG23498), [Ayush Thakur](https://twitter.com/ayushthakur0) (equal contribution)**Date created:** 2022/01/12**Last modified:** 2024/01/15**Description:** A Transformer-based architecture for video classificati...
keras-io/examples/vision/ipynb/vivit.ipynb/0
{ "file_path": "keras-io/examples/vision/ipynb/vivit.ipynb", "repo_id": "keras-io", "token_count": 4785 }
121
# OCR model for reading Captchas **Author:** [A_K_Nain](https://twitter.com/A_K_Nain)<br> **Date created:** 2020/06/14<br> **Last modified:** 2020/06/26<br> **Description:** How to implement an OCR model using CNNs, RNNs and CTC loss. <img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favico...
keras-io/examples/vision/md/captcha_ocr.md/0
{ "file_path": "keras-io/examples/vision/md/captcha_ocr.md", "repo_id": "keras-io", "token_count": 18879 }
122
# Gradient Centralization for Better Training Performance **Author:** [Rishit Dagli](https://github.com/Rishit-dagli)<br> **Date created:** 06/18/21<br> **Last modified:** 07/25/23<br> **Description:** Implement Gradient Centralization to improve training performance of DNNs. <img class="k-inline-icon" src="https://...
keras-io/examples/vision/md/gradient_centralization.md/0
{ "file_path": "keras-io/examples/vision/md/gradient_centralization.md", "repo_id": "keras-io", "token_count": 12424 }
123
# MixUp augmentation for image classification **Author:** [Sayak Paul](https://twitter.com/RisingSayak)<br> **Date created:** 2021/03/06<br> **Last modified:** 2023/07/24<br> **Description:** Data augmentation using the mixup technique for image classification. <img class="k-inline-icon" src="https://colab.research....
keras-io/examples/vision/md/mixup.md/0
{ "file_path": "keras-io/examples/vision/md/mixup.md", "repo_id": "keras-io", "token_count": 5391 }
124
# Few-Shot learning with Reptile **Author:** [ADMoreau](https://github.com/ADMoreau)<br> **Date created:** 2020/05/21<br> **Last modified:** 2023/07/20<br> **Description:** Few-shot classification on the Omniglot dataset using Reptile. <img class="k-inline-icon" src="https://colab.research.google.com/img/colab_favic...
keras-io/examples/vision/md/reptile.md/0
{ "file_path": "keras-io/examples/vision/md/reptile.md", "repo_id": "keras-io", "token_count": 5743 }
125
""" Title: Natural language image search with a Dual Encoder Author: [Khalid Salama](https://www.linkedin.com/in/khalid-salama-24403144/) Date created: 2021/01/30 Last modified: 2021/01/30 Description: Implementation of a dual encoder model for retrieving images that match natural language queries. Accelerator: GPU """...
keras-io/examples/vision/nl_image_search.py/0
{ "file_path": "keras-io/examples/vision/nl_image_search.py", "repo_id": "keras-io", "token_count": 8032 }
126
""" Title: A Vision Transformer without Attention Author: [Aritra Roy Gosthipaty](https://twitter.com/ariG23498), [Ritwik Raha](https://twitter.com/ritwik_raha), [Shivalika Singh](https://www.linkedin.com/in/shivalika-singh/) Date created: 2022/02/24 Last modified: 2022/10/15 Description: A minimal implementation of Sh...
keras-io/examples/vision/shiftvit.py/0
{ "file_path": "keras-io/examples/vision/shiftvit.py", "repo_id": "keras-io", "token_count": 14401 }
127
<jupyter_start><jupyter_text>Customizing what happens in `fit()` with JAX**Author:** [fchollet](https://twitter.com/fchollet)**Date created:** 2023/06/27**Last modified:** 2023/06/27**Description:** Overriding the training step of the Model class with JAX. IntroductionWhen you're doing supervised learning, you can use...
keras-io/guides/ipynb/custom_train_step_in_jax.ipynb/0
{ "file_path": "keras-io/guides/ipynb/custom_train_step_in_jax.ipynb", "repo_id": "keras-io", "token_count": 4565 }
128
<jupyter_start><jupyter_text>Multi-GPU distributed training with JAX**Author:** [fchollet](https://twitter.com/fchollet)**Date created:** 2023/07/11**Last modified:** 2023/07/11**Description:** Guide to multi-GPU/TPU training for Keras models with JAX. IntroductionThere are generally two ways to distribute computation...
keras-io/guides/ipynb/keras_core/distributed_training_with_jax.ipynb/0
{ "file_path": "keras-io/guides/ipynb/keras_core/distributed_training_with_jax.ipynb", "repo_id": "keras-io", "token_count": 3224 }
129
<jupyter_start><jupyter_text>Using KerasCV COCO Metrics**Author:** [lukewood](https://twitter.com/luke_wood_ml)**Date created:** 2022/04/13**Last modified:** 2022/04/13**Description:** Use KerasCV COCO metrics to evaluate object detection models. OverviewWith KerasCV's COCO metrics implementation, you can easily evalu...
keras-io/guides/ipynb/keras_cv/coco_metrics.ipynb/0
{ "file_path": "keras-io/guides/ipynb/keras_cv/coco_metrics.ipynb", "repo_id": "keras-io", "token_count": 1530 }
130
<jupyter_start><jupyter_text>Making new layers and models via subclassing**Author:** [fchollet](https://twitter.com/fchollet)**Date created:** 2019/03/01**Last modified:** 2023/06/25**Description:** Complete guide to writing `Layer` and `Model` objects from scratch. IntroductionThis guide will cover everything you nee...
keras-io/guides/ipynb/making_new_layers_and_models_via_subclassing.ipynb/0
{ "file_path": "keras-io/guides/ipynb/making_new_layers_and_models_via_subclassing.ipynb", "repo_id": "keras-io", "token_count": 7448 }
131
# Custom Image Augmentations with BaseImageAugmentationLayer **Author:** [lukewood](https://twitter.com/luke_wood_ml)<br> **Date created:** 2022/04/26<br> **Last modified:** 2023/11/29<br> **Description:** Use BaseImageAugmentationLayer to implement custom data augmentations. <img class="k-inline-icon" src="https://...
keras-io/guides/md/keras_cv/custom_image_augmentations.md/0
{ "file_path": "keras-io/guides/md/keras_cv/custom_image_augmentations.md", "repo_id": "keras-io", "token_count": 6524 }
132
# Migrating Keras 2 code to multi-backend Keras 3 **Author:** [Divyashree Sreepathihalli](https://github.com/divyashreepathihalli)<br> **Date created:** 2023/10/23<br> **Last modified:** 2023/10/30<br> **Description:** Instructions & troubleshooting for migrating your Keras 2 code to multi-backend Keras 3. <img clas...
keras-io/guides/md/migrating_to_keras_3.md/0
{ "file_path": "keras-io/guides/md/migrating_to_keras_3.md", "repo_id": "keras-io", "token_count": 13936 }
133
<meta http-equiv="refresh" content="0; URL='https://keras.io/api/keras_nlp/modeling_layers/transformer_decoder/'" />
keras-io/redirects/api/keras_nlp/layers/transformer_decoder/index.html/0
{ "file_path": "keras-io/redirects/api/keras_nlp/layers/transformer_decoder/index.html", "repo_id": "keras-io", "token_count": 47 }
134
<meta http-equiv="refresh" content="0; URL='https://keras.io/getting_started/faq/'" />
keras-io/redirects/getting-started/faq/index.html/0
{ "file_path": "keras-io/redirects/getting-started/faq/index.html", "repo_id": "keras-io", "token_count": 34 }
135
<meta http-equiv="refresh" content="0; URL='https://keras.io/api/layers/recurrent_layers/'" />
keras-io/redirects/layers/recurrent/index.html/0
{ "file_path": "keras-io/redirects/layers/recurrent/index.html", "repo_id": "keras-io", "token_count": 38 }
136
<meta http-equiv="refresh" content="0; URL='https://keras.io/api/utils/model_plotting_utils/'" />
keras-io/redirects/visualization/index.html/0
{ "file_path": "keras-io/redirects/visualization/index.html", "repo_id": "keras-io", "token_count": 38 }
137
<jupyter_start><jupyter_text>Learning to Resize in Computer Vision**Author:** [Sayak Paul](https://twitter.com/RisingSayak)**Date created:** 2021/04/30**Last modified:** 2023/12/18**Description:** How to optimally learn representations of images for a given resolution. It is a common belief that if we constrain vision ...
keras-io/scripts/tmp_2343486/learnable_resizer.ipynb/0
{ "file_path": "keras-io/scripts/tmp_2343486/learnable_resizer.ipynb", "repo_id": "keras-io", "token_count": 2879 }
138
# KerasNLP Layers KerasNLP layers are `keras.Layer` subclasses for NLP-specific use cases. These layers are building blocks for common NLP model architectures (e.g. Transformers). {{toc}}
keras-io/templates/api/keras_nlp/layers/index.md/0
{ "file_path": "keras-io/templates/api/keras_nlp/layers/index.md", "repo_id": "keras-io", "token_count": 59 }
139
# Layer weight initializers ## Usage of initializers Initializers define the way to set the initial random weights of Keras layers. The keyword arguments used for passing initializers to layers depends on the layer. Usually, it is simply `kernel_initializer` and `bias_initializer`: ```python from keras import layer...
keras-io/templates/api/layers/initializers.md/0
{ "file_path": "keras-io/templates/api/layers/initializers.md", "repo_id": "keras-io", "token_count": 801 }
140
.blog-content { text-align: justify; padding: 2em; } strong { font-weight: 600; font-family: Arial; font-size: 1.1em; } .irasto { width: 96%; margin-left: 2%; } h2 { margin-top: 1em; margin-bottom: 1em; } h3 { font-size: 1.5rem; } .credits { text-align: center; paddi...
keras-io/theme/css/announcement.css/0
{ "file_path": "keras-io/theme/css/announcement.css", "repo_id": "keras-io", "token_count": 429 }
141
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="description" content="Keras Core documentation"> <meta name="author" content="Keras Team"> <title>Keras: Deep Learning for humans</title> <!--...
keras-io/theme/keras_3.html/0
{ "file_path": "keras-io/theme/keras_3.html", "repo_id": "keras-io", "token_count": 1570 }
142
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/benchmarks/text_generation.py/0
{ "file_path": "keras-nlp/benchmarks/text_generation.py", "repo_id": "keras-nlp", "token_count": 2232 }
143
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/examples/machine_translation/model.py/0
{ "file_path": "keras-nlp/examples/machine_translation/model.py", "repo_id": "keras-nlp", "token_count": 1848 }
144
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/layers/modeling/reversible_embedding.py/0
{ "file_path": "keras-nlp/keras_nlp/layers/modeling/reversible_embedding.py", "repo_id": "keras-nlp", "token_count": 2502 }
145
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/layers/preprocessing/masked_lm_mask_generator_test.py/0
{ "file_path": "keras-nlp/keras_nlp/layers/preprocessing/masked_lm_mask_generator_test.py", "repo_id": "keras-nlp", "token_count": 3528 }
146
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/metrics/perplexity_test.py/0
{ "file_path": "keras-nlp/keras_nlp/metrics/perplexity_test.py", "repo_id": "keras-nlp", "token_count": 6016 }
147
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/albert/albert_preprocessor.py/0
{ "file_path": "keras-nlp/keras_nlp/models/albert/albert_preprocessor.py", "repo_id": "keras-nlp", "token_count": 3242 }
148
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/deberta_v3/deberta_v3_classifier_test.py/0
{ "file_path": "keras-nlp/keras_nlp/models/deberta_v3/deberta_v3_classifier_test.py", "repo_id": "keras-nlp", "token_count": 1381 }
149
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/distil_bert/distil_bert_classifier.py/0
{ "file_path": "keras-nlp/keras_nlp/models/distil_bert/distil_bert_classifier.py", "repo_id": "keras-nlp", "token_count": 3297 }
150
# Copyright 2024 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/gemma/gemma_backbone.py/0
{ "file_path": "keras-nlp/keras_nlp/models/gemma/gemma_backbone.py", "repo_id": "keras-nlp", "token_count": 4765 }
151
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/gpt2/gpt2_backbone.py/0
{ "file_path": "keras-nlp/keras_nlp/models/gpt2/gpt2_backbone.py", "repo_id": "keras-nlp", "token_count": 3367 }
152
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/gpt_neo_x/gpt_neo_x_causal_lm_preprocessor.py/0
{ "file_path": "keras-nlp/keras_nlp/models/gpt_neo_x/gpt_neo_x_causal_lm_preprocessor.py", "repo_id": "keras-nlp", "token_count": 2347 }
153
# Copyright 2022 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/opt/opt_backbone.py/0
{ "file_path": "keras-nlp/keras_nlp/models/opt/opt_backbone.py", "repo_id": "keras-nlp", "token_count": 2745 }
154
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/roberta/roberta_classifier_test.py/0
{ "file_path": "keras-nlp/keras_nlp/models/roberta/roberta_classifier_test.py", "repo_id": "keras-nlp", "token_count": 1396 }
155
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/models/whisper/whisper_tokenizer.py/0
{ "file_path": "keras-nlp/keras_nlp/models/whisper/whisper_tokenizer.py", "repo_id": "keras-nlp", "token_count": 2796 }
156
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/samplers/serialization.py/0
{ "file_path": "keras-nlp/keras_nlp/samplers/serialization.py", "repo_id": "keras-nlp", "token_count": 1259 }
157
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/tokenizers/tokenizer_test.py/0
{ "file_path": "keras-nlp/keras_nlp/tokenizers/tokenizer_test.py", "repo_id": "keras-nlp", "token_count": 625 }
158
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/keras_nlp/utils/tensor_utils.py/0
{ "file_path": "keras-nlp/keras_nlp/utils/tensor_utils.py", "repo_id": "keras-nlp", "token_count": 2409 }
159
# Copyright 2023 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/tools/checkpoint_conversion/convert_f_net_checkpoints.py/0
{ "file_path": "keras-nlp/tools/checkpoint_conversion/convert_f_net_checkpoints.py", "repo_id": "keras-nlp", "token_count": 3089 }
160
# Copyright 2024 The KerasNLP Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
keras-nlp/tools/gemma/run_gemma_xla.py/0
{ "file_path": "keras-nlp/tools/gemma/run_gemma_xla.py", "repo_id": "keras-nlp", "token_count": 4199 }
161
[report] fail_under = 85 show_missing = True
keras-preprocessing/.coveragerc/0
{ "file_path": "keras-preprocessing/.coveragerc", "repo_id": "keras-preprocessing", "token_count": 16 }
162
COPYRIGHT Copyright (c) 2015 - 2018, the respective contributors. All rights reserved. Each contributor holds copyright over their respective contributions. The project versioning (Git) records all such contribution source information. The initial code of this repository came from https://github.com/keras-team/keras ...
keras-preprocessing/LICENSE/0
{ "file_path": "keras-preprocessing/LICENSE", "repo_id": "keras-preprocessing", "token_count": 384 }
163
from setuptools import find_packages, setup long_description = ''' Keras Preprocessing is the data preprocessing and data augmentation module of the Keras deep learning library. It provides utilities for working with image data, text data, and sequence data. Read the documentation at: https://keras.io/ Keras Preproc...
keras-preprocessing/setup.py/0
{ "file_path": "keras-preprocessing/setup.py", "repo_id": "keras-preprocessing", "token_count": 823 }
164
# How to Contribute We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow. ## Contributor License Agreement Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your ...
keras-tuner/CONTRIBUTING.md/0
{ "file_path": "keras-tuner/CONTRIBUTING.md", "repo_id": "keras-tuner", "token_count": 867 }
165
# Copyright 2019 The KerasTuner Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
keras-tuner/keras_tuner/__init__.py/0
{ "file_path": "keras-tuner/keras_tuner/__init__.py", "repo_id": "keras-tuner", "token_count": 388 }
166
# Copyright 2019 The KerasTuner Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
keras-tuner/keras_tuner/engine/hyperparameters/__init__.py/0
{ "file_path": "keras-tuner/keras_tuner/engine/hyperparameters/__init__.py", "repo_id": "keras-tuner", "token_count": 520 }
167
# Copyright 2019 The KerasTuner Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
keras-tuner/keras_tuner/errors.py/0
{ "file_path": "keras-tuner/keras_tuner/errors.py", "repo_id": "keras-tuner", "token_count": 981 }
168
# Copyright 2019 The KerasTuner Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
keras-tuner/keras_tuner/tuners/sklearn_tuner_test.py/0
{ "file_path": "keras-tuner/keras_tuner/tuners/sklearn_tuner_test.py", "repo_id": "keras-tuner", "token_count": 4892 }
169
# Dev container configurations This directory contains the configuration for dev containers, which is used to initialize the development environment in **Codespaces**, **Visual Studio Code**, and **JetBrains IDEs**. The environment is installed with all the necessary dependencies for development and is ready for linti...
keras/.devcontainer/README.md/0
{ "file_path": "keras/.devcontainer/README.md", "repo_id": "keras", "token_count": 362 }
170
"""Benchmark regularization layers. To run benchmarks, see the following command for an example, please change the flag to your custom value: ``` python3 -m benchmarks.layer_benchmark.regularization_benchmark \ --benchmark_name=benchmark_dropout\ --num_samples=2048 \ --batch_size=256 \ --jit_compile=T...
keras/benchmarks/layer_benchmark/regularization_benchmark.py/0
{ "file_path": "keras/benchmarks/layer_benchmark/regularization_benchmark.py", "repo_id": "keras", "token_count": 2198 }
171
# flake8: noqa import os # Set backend env to tensorflow os.environ["KERAS_BACKEND"] = "tensorflow" import numpy as np import tensorflow as tf from keras import Model from keras import backend from keras import initializers from keras import layers from keras import ops from keras import optimizers class MyDense(l...
keras/examples/demo_custom_tf_workflow.py/0
{ "file_path": "keras/examples/demo_custom_tf_workflow.py", "repo_id": "keras", "token_count": 895 }
172
from keras.backend.common import global_state class name_scope: """Creates a sub-namespace for variable paths. Args: name: Name of the current scope (string). caller: Optional ID of a caller object (e.g. class instance). deduplicate: If `True`, if `caller` was passed, and ...
keras/keras/backend/common/name_scope.py/0
{ "file_path": "keras/keras/backend/common/name_scope.py", "repo_id": "keras", "token_count": 902 }
173
import jax import jax.numpy as jnp import numpy as np from jax import lax from jax import nn as jnn from keras.backend import standardize_data_format from keras.backend import standardize_dtype from keras.backend.common.backend_utils import ( compute_conv_transpose_padding_args_for_jax, ) from keras.backend.config...
keras/keras/backend/jax/nn.py/0
{ "file_path": "keras/keras/backend/jax/nn.py", "repo_id": "keras", "token_count": 7943 }
174
import numpy as np import tree from keras.utils.nest import pack_sequence_as def rnn( step_function, inputs, initial_states, go_backwards=False, mask=None, constants=None, unroll=False, input_length=None, time_major=False, zero_output_for_mask=False, return_all_outputs=Tru...
keras/keras/backend/numpy/rnn.py/0
{ "file_path": "keras/keras/backend/numpy/rnn.py", "repo_id": "keras", "token_count": 3963 }
175
import tensorflow as tf import tree from keras.utils.nest import pack_sequence_as def rnn( step_function, inputs, initial_states, go_backwards=False, mask=None, constants=None, unroll=False, input_length=None, time_major=False, zero_output_for_mask=False, return_all_output...
keras/keras/backend/tensorflow/rnn.py/0
{ "file_path": "keras/keras/backend/tensorflow/rnn.py", "repo_id": "keras", "token_count": 16379 }
176
from keras.backend.torch.optimizers.torch_optimizer import TorchOptimizer
keras/keras/backend/torch/optimizers/__init__.py/0
{ "file_path": "keras/keras/backend/torch/optimizers/__init__.py", "repo_id": "keras", "token_count": 24 }
177
from keras.api_export import keras_export from keras.callbacks.callback import Callback from keras.utils import file_utils @keras_export("keras.callbacks.BackupAndRestore") class BackupAndRestore(Callback): """Callback to back up and restore the training state. `BackupAndRestore` callback is intended to reco...
keras/keras/callbacks/backup_and_restore_callback.py/0
{ "file_path": "keras/keras/callbacks/backup_and_restore_callback.py", "repo_id": "keras", "token_count": 2461 }
178
from keras.api_export import keras_export from keras.callbacks.callback import Callback from keras.utils import io_utils from keras.utils.progbar import Progbar @keras_export("keras.callbacks.ProgbarLogger") class ProgbarLogger(Callback): """Callback that prints metrics to stdout. Args: count_mode: O...
keras/keras/callbacks/progbar_logger.py/0
{ "file_path": "keras/keras/callbacks/progbar_logger.py", "repo_id": "keras", "token_count": 1426 }
179
"""Tests for inference-only model/layer exporting utilities.""" import os import numpy as np import pytest import tensorflow as tf from keras import backend from keras import layers from keras import models from keras import testing from keras import utils from keras.export import export_lib from keras.saving import...
keras/keras/export/export_lib_test.py/0
{ "file_path": "keras/keras/export/export_lib_test.py", "repo_id": "keras", "token_count": 12701 }
180
import numpy as np import pytest from keras import testing from keras.layers.activations import prelu class PReLUTest(testing.TestCase): @pytest.mark.requires_trainable_backend def test_prelu(self): self.run_layer_test( prelu.PReLU, init_kwargs={ "alpha_initial...
keras/keras/layers/activations/prelu_test.py/0
{ "file_path": "keras/keras/layers/activations/prelu_test.py", "repo_id": "keras", "token_count": 605 }
181
"""Keras base class for transpose convolution layers.""" from keras import activations from keras import constraints from keras import initializers from keras import ops from keras import regularizers from keras.backend import standardize_data_format from keras.backend.common.backend_utils import ( compute_conv_tr...
keras/keras/layers/convolutional/base_conv_transpose.py/0
{ "file_path": "keras/keras/layers/convolutional/base_conv_transpose.py", "repo_id": "keras", "token_count": 4802 }
182
import numpy as np import pytest from absl.testing import parameterized from keras import layers from keras import testing from keras.layers.convolutional.conv_test import np_conv1d from keras.layers.convolutional.conv_test import np_conv2d from keras.layers.convolutional.depthwise_conv_test import np_depthwise_conv1d...
keras/keras/layers/convolutional/separable_conv_test.py/0
{ "file_path": "keras/keras/layers/convolutional/separable_conv_test.py", "repo_id": "keras", "token_count": 6430 }
183
from keras.api_export import keras_export from keras.layers.layer import Layer from keras.saving import serialization_lib @keras_export("keras.layers.Wrapper") class Wrapper(Layer): """Abstract wrapper base class. Wrappers take another layer and augment it in various ways. Do not use this class as a laye...
keras/keras/layers/core/wrapper.py/0
{ "file_path": "keras/keras/layers/core/wrapper.py", "repo_id": "keras", "token_count": 634 }
184
from keras import backend from keras.layers.input_spec import InputSpec from keras.layers.layer import Layer class BaseGlobalPooling(Layer): """Base global pooling layer.""" def __init__( self, pool_dimensions, data_format=None, keepdims=False, **kwargs ): super().__init__(**kwargs) ...
keras/keras/layers/pooling/base_global_pooling.py/0
{ "file_path": "keras/keras/layers/pooling/base_global_pooling.py", "repo_id": "keras", "token_count": 756 }
185
import numpy as np from tensorflow import data as tf_data from keras import layers from keras import testing class CategoryEncodingTest(testing.TestCase): def test_count_output(self): input_array = np.array([1, 2, 3, 1]) expected_output = np.array([0, 2, 1, 1, 0, 0]) num_tokens = 6 ...
keras/keras/layers/preprocessing/category_encoding_test.py/0
{ "file_path": "keras/keras/layers/preprocessing/category_encoding_test.py", "repo_id": "keras", "token_count": 3515 }
186
import numpy as np import pytest from absl.testing import parameterized from tensorflow import data as tf_data from keras import backend from keras import layers from keras import testing class NormalizationTest(testing.TestCase, parameterized.TestCase): @pytest.mark.requires_trainable_backend def test_norma...
keras/keras/layers/preprocessing/normalization_test.py/0
{ "file_path": "keras/keras/layers/preprocessing/normalization_test.py", "repo_id": "keras", "token_count": 1905 }
187
import numpy as np import pytest from tensorflow import data as tf_data from keras import backend from keras import layers from keras import testing class RescalingTest(testing.TestCase): @pytest.mark.requires_trainable_backend def test_rescaling_basics(self): self.run_layer_test( layers....
keras/keras/layers/preprocessing/rescaling_test.py/0
{ "file_path": "keras/keras/layers/preprocessing/rescaling_test.py", "repo_id": "keras", "token_count": 1522 }
188
import numpy as np import pytest from keras import backend from keras import layers from keras import testing class GaussianDropoutTest(testing.TestCase): @pytest.mark.requires_trainable_backend def test_gaussian_dropout_basics(self): self.run_layer_test( layers.GaussianDropout, ...
keras/keras/layers/regularization/gaussian_dropout_test.py/0
{ "file_path": "keras/keras/layers/regularization/gaussian_dropout_test.py", "repo_id": "keras", "token_count": 509 }
189
from keras import ops from keras.api_export import keras_export from keras.layers.input_spec import InputSpec from keras.layers.layer import Layer @keras_export("keras.layers.RepeatVector") class RepeatVector(Layer): """Repeats the input n times. Example: >>> x = keras.Input(shape=(32,)) >>> y = ker...
keras/keras/layers/reshaping/repeat_vector.py/0
{ "file_path": "keras/keras/layers/reshaping/repeat_vector.py", "repo_id": "keras", "token_count": 577 }
190
import numpy as np import pytest from absl.testing import parameterized from keras import initializers from keras import layers from keras import testing class LSTMTest(testing.TestCase, parameterized.TestCase): @pytest.mark.requires_trainable_backend def test_basics(self): self.run_layer_test( ...
keras/keras/layers/rnn/lstm_test.py/0
{ "file_path": "keras/keras/layers/rnn/lstm_test.py", "repo_id": "keras", "token_count": 5689 }
191
"""Deprecated text preprocessing APIs from Keras 1.""" import collections import hashlib import json import warnings import numpy as np from keras.api_export import keras_export @keras_export("keras._legacy.preprocessing.text.text_to_word_sequence") def text_to_word_sequence( input_text, filters='!"#$%&()*...
keras/keras/legacy/preprocessing/text.py/0
{ "file_path": "keras/keras/legacy/preprocessing/text.py", "repo_id": "keras", "token_count": 5877 }
192
import re import numpy as np from keras import testing from keras.metrics import accuracy_metrics class AccuracyTest(testing.TestCase): def test_config(self): acc_obj = accuracy_metrics.Accuracy(name="accuracy", dtype="float32") self.assertEqual(acc_obj.name, "accuracy") self.assertEqual...
keras/keras/metrics/accuracy_metrics_test.py/0
{ "file_path": "keras/keras/metrics/accuracy_metrics_test.py", "repo_id": "keras", "token_count": 6687 }
193
import warnings from keras import initializers from keras import ops from keras.api_export import keras_export from keras.losses.loss import squeeze_or_expand_to_same_rank from keras.losses.losses import log_cosh from keras.losses.losses import mean_absolute_error from keras.losses.losses import mean_absolute_percenta...
keras/keras/metrics/regression_metrics.py/0
{ "file_path": "keras/keras/metrics/regression_metrics.py", "repo_id": "keras", "token_count": 9079 }
194
import collections import tree from keras.api_export import keras_export from keras.backend import KerasTensor from keras.backend.config import backend from keras.ops.operation import Operation from keras.utils.nest import pack_sequence_as @keras_export("keras.Function") class Function(Operation): """Class that...
keras/keras/ops/function.py/0
{ "file_path": "keras/keras/ops/function.py", "repo_id": "keras", "token_count": 6597 }
195
import math import numpy as np import tree from keras.api_export import keras_export def broadcast_shapes(shape1, shape2): """Broadcast input shapes to a unified shape. Convert to list for mutability. Args: shape1: A tuple or list of integers. shape2: A tuple or list of integers. ...
keras/keras/ops/operation_utils.py/0
{ "file_path": "keras/keras/ops/operation_utils.py", "repo_id": "keras", "token_count": 6022 }
196
# flake8: noqa import numpy as np from keras import backend from keras import ops from keras import testing from keras.optimizers.adamw import AdamW class AdamWTest(testing.TestCase): def test_config(self): optimizer = AdamW( learning_rate=0.5, weight_decay=0.008, be...
keras/keras/optimizers/adamw_test.py/0
{ "file_path": "keras/keras/optimizers/adamw_test.py", "repo_id": "keras", "token_count": 1730 }
197
"""Various learning rate schedule functions.""" import math from keras import ops from keras.api_export import keras_export from keras.saving import serialization_lib @keras_export("keras.optimizers.schedules.LearningRateSchedule") class LearningRateSchedule: """The learning rate schedule base class. You c...
keras/keras/optimizers/schedules/learning_rate_schedule.py/0
{ "file_path": "keras/keras/optimizers/schedules/learning_rate_schedule.py", "repo_id": "keras", "token_count": 15351 }
198
import os import zipfile from absl import logging from keras.api_export import keras_export from keras.legacy.saving import legacy_h5_format from keras.saving import saving_lib from keras.utils import file_utils from keras.utils import io_utils try: import h5py except ImportError: h5py = None @keras_export...
keras/keras/saving/saving_api.py/0
{ "file_path": "keras/keras/saving/saving_api.py", "repo_id": "keras", "token_count": 3968 }
199