Remove import keras as keras (#18725)

This commit is contained in:
Matt Watson 2023-11-03 13:27:41 -07:00 committed by GitHub
parent b7c0e04533
commit bc4308ce1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
102 changed files with 102 additions and 102 deletions

@ -21,7 +21,7 @@ from absl import flags
from absl import logging
from model_benchmark.benchmark_utils import BenchmarkMetricsCallback
import keras as keras
import keras
flags.DEFINE_string("model_size", "small", "The size of model to benchmark.")
flags.DEFINE_string(

@ -27,7 +27,7 @@ from absl import flags
from absl import logging
from model_benchmark.benchmark_utils import BenchmarkMetricsCallback
import keras as keras
import keras
flags.DEFINE_string("model", "EfficientNetV2B0", "The model to benchmark.")
flags.DEFINE_integer("epochs", 1, "The number of epochs.")

@ -5,7 +5,7 @@ from keras import layers
from keras import losses
from keras import metrics
from keras import optimizers
import keras as keras
import keras
keras.config.disable_traceback_filtering()

@ -11,7 +11,7 @@ pp = pprint.PrettyPrinter()
import jax
import jax.numpy as jnp
import tensorflow as tf # just for tf.data
import keras as keras # Keras multi-backend
import keras # Keras multi-backend
import numpy as np
from tqdm import tqdm

@ -41,7 +41,7 @@ import os
os.environ["KERAS_BACKEND"] = "jax"
import keras_nlp
import keras as keras
import keras
import tensorflow.data as tf_data
import tensorflow.strings as tf_strings

@ -42,7 +42,7 @@ with TensorFlow 2.3 or higher.
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
import keras as keras
import keras
from keras import layers
from keras import ops
from keras.layers import TextVectorization

@ -46,7 +46,7 @@ Five digits (reversed):
## Setup
"""
import keras as keras
import keras
from keras import layers
import numpy as np

@ -11,7 +11,7 @@ Accelerator: GPU
"""
import numpy as np
import keras as keras
import keras
from keras import layers
max_features = 20000 # Only consider the top 20k words

@ -29,7 +29,7 @@ import os
os.environ["KERAS_BACKEND"] = "jax" # or "tensorflow" or "torch"
import keras_nlp
import keras as keras
import keras
import tensorflow as tf
import numpy as np

@ -52,7 +52,7 @@ import keras_nlp
import pathlib
import random
import keras as keras
import keras
from keras import ops
import tensorflow.data as tf_data

@ -53,7 +53,7 @@ import numpy as np
import tensorflow.data as tf_data
import tensorflow.strings as tf_strings
import keras as keras
import keras
from keras import layers
from keras import ops
from keras.layers import TextVectorization

@ -84,7 +84,7 @@ import nltk
import random
import logging
import keras as keras
import keras
nltk.download("punkt")
# Set random seed

@ -46,7 +46,7 @@ import torch.nn.functional as F
import torchvision
from torchvision import datasets, models, transforms
import keras as keras
import keras
from keras.layers import TorchModuleWrapper
"""

@ -37,7 +37,7 @@ import matplotlib.pyplot as plt
import numpy as np
from zipfile import ZipFile
import keras as keras
import keras
from keras import layers
from keras import ops

@ -33,7 +33,7 @@ and 9 categorical features.
## Setup
"""
import keras as keras
import keras
from keras import layers
from keras.layers import StringLookup
from keras import ops

@ -21,7 +21,7 @@ into robust contextual embeddings to achieve higher predictive accuracy.
## Setup
"""
import keras as keras
import keras
from keras import layers
from keras import ops

@ -47,7 +47,7 @@ import shutil
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from pathlib import Path
from IPython.display import display, Audio

@ -108,7 +108,7 @@ import pandas as pd
import tensorflow as tf
import tensorflow_hub as hub
import tensorflow_io as tfio
import keras as keras
import keras
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats

@ -27,7 +27,7 @@ using cycle-consistent adversarial networks.
import numpy as np
import matplotlib.pyplot as plt
import keras as keras
import keras
from keras import layers
from keras import ops

@ -11,7 +11,7 @@ Accelerator: GPU
"""
import tensorflow as tf
import keras as keras
import keras
from keras import layers
import matplotlib.pyplot as plt
import os

@ -72,7 +72,7 @@ import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_datasets as tfds
import keras as keras
import keras
from keras import layers
from keras import ops

@ -90,7 +90,7 @@ import matplotlib.pyplot as plt
# Requires TensorFlow >=2.11 for the GroupNormalization layer.
import tensorflow as tf
import keras as keras
import keras
from keras import layers
import tensorflow_datasets as tfds

@ -38,7 +38,7 @@ and compare the result to the (resized) original image.
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from keras.applications import inception_v3
base_image_path = keras.utils.get_file(

@ -25,7 +25,7 @@ has at least ~100k characters. ~1M is better.
"""
## Setup
"""
import keras as keras
import keras
from keras import layers
import numpy as np

@ -40,7 +40,7 @@ keeping the generated image close enough to the original one.
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from keras.applications import vgg19
base_image_path = keras.utils.get_file(

@ -13,7 +13,7 @@ Accelerator: GPU
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from keras import layers
"""

@ -30,7 +30,7 @@ that keeps the L2 norm of the discriminator gradients close to 1.
"""
import tensorflow as tf
import keras as keras
import keras
from keras import layers

@ -23,7 +23,7 @@ features back to a space of the original size.
"""
import tensorflow as tf
import keras as keras
import keras
from keras import layers
"""

@ -12,7 +12,7 @@ Accelerator: GPU
"""
import tensorflow as tf
import keras as keras
import keras
import numpy as np
"""

@ -27,7 +27,7 @@ Using this approach, we can quickly implement a
[StandardizedConv2D](https://arxiv.org/abs/1903.10520) as shown below.
"""
import tensorflow as tf
import keras as keras
import keras
from keras import layers
import numpy as np

@ -29,7 +29,7 @@ TensorFlow NumPy requires TensorFlow 2.5 or later.
import tensorflow as tf
import tensorflow.experimental.numpy as tnp
import keras as keras
import keras
from keras import layers
"""

@ -60,7 +60,7 @@ import shutil
import requests
import numpy as np
import tensorflow as tf
import keras as keras
import keras
import matplotlib.pyplot as plt
"""

@ -25,7 +25,7 @@ by putting the custom training step in the Trainer class definition.
"""
import tensorflow as tf
import keras as keras
import keras
# Load MNIST dataset and standardize the data
mnist = keras.datasets.mnist

@ -50,7 +50,7 @@ from pathlib import Path
from dataclasses import dataclass
import tensorflow as tf
import keras as keras
import keras
from keras import layers
"""

@ -47,7 +47,7 @@ models are more common in this domain.
"""
import numpy as np
import keras as keras
import keras
import os
from pathlib import Path

@ -34,7 +34,7 @@ wget https://raw.githubusercontent.com/sighsmile/conlleval/master/conlleval.py
import os
import numpy as np
import keras as keras
import keras
from keras import layers
from datasets import load_dataset
from collections import Counter

@ -13,7 +13,7 @@ Accelerator: GPU
import numpy as np
import tensorflow.data as tf_data
import keras as keras
import keras
"""
## Introduction

@ -20,7 +20,7 @@ classification dataset (unprocessed version). We use the `TextVectorization` lay
"""
import tensorflow as tf
import keras as keras
import keras
from keras.layers import TextVectorization
from keras import layers
import string

@ -44,7 +44,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras as keras
import keras
from keras import layers
import gym

@ -20,7 +20,7 @@ to train a classification model on data with highly imbalanced classes.
"""
import numpy as np
import keras as keras
import keras
# Get the real data from https://www.kaggle.com/mlg-ulb/creditcardfraud/
fname = "/Users/fchollet/Downloads/creditcard.csv"

@ -51,7 +51,7 @@ Target | Diagnosis of heart disease (1 = true; 0 = false) | Target
import tensorflow as tf
import pandas as pd
import keras as keras
import keras
from keras import layers
"""

@ -61,7 +61,7 @@ Target | Diagnosis of heart disease (1 = true; 0 = false) | Target
import tensorflow as tf
import pandas as pd
import keras as keras
import keras
from keras.utils import FeatureSpace
keras.config.disable_traceback_filtering()

@ -65,7 +65,7 @@ import pandas as pd
import matplotlib.pyplot as plt
import json
import numpy as np
import keras as keras
import keras
from keras import layers
import tensorflow as tf
from sklearn import preprocessing, model_selection

@ -47,7 +47,7 @@ import typing
import matplotlib.pyplot as plt
import tensorflow as tf
import keras as keras
import keras
from keras import layers
from keras.utils import timeseries_dataset_from_array

@ -14,7 +14,7 @@ This example requires TensorFlow 2.3 or higher.
import pandas as pd
import matplotlib.pyplot as plt
import keras as keras
import keras
"""
## Climate Data Time-Series

@ -42,7 +42,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras as keras
import keras
import numpy as np
import matplotlib.pyplot as plt

@ -48,7 +48,7 @@ where `rx, ry` are randomly drawn from a uniform distribution with upper bound.
import numpy as np
import pandas as pd
import keras as keras
import keras
import matplotlib.pyplot as plt
from keras import layers

@ -49,7 +49,7 @@ os.environ["KERAS_BACKEND"] = "tensorflow"
import tensorflow as tf
import tensorflow_datasets as tfds
import keras as keras
import keras
from keras import layers
tfds.disable_progress_bar()

@ -13,7 +13,7 @@ Adapted from Deep Learning with Python (2017).
import numpy as np
import tensorflow as tf
import keras as keras
import keras
# Display
from IPython.display import Image, display

@ -17,7 +17,7 @@ import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import keras as keras
import keras
from keras import layers
from keras.applications import efficientnet
from keras.layers import TextVectorization

@ -23,7 +23,7 @@ we use Keras image preprocessing layers for image standardization and data augme
"""
import tensorflow as tf
import keras as keras
import keras
from keras import layers
import os
from pathlib import Path

@ -58,7 +58,7 @@ from scipy import ndimage
from IPython.display import Image, display
import tensorflow as tf
import keras as keras
import keras
from keras import layers
from keras.applications import xception

@ -36,7 +36,7 @@ layer.
"""
import tensorflow as tf
import keras as keras
import keras
import matplotlib.pyplot as plt
# Set seed for reproducibility.

@ -47,7 +47,7 @@ from glob import glob
from PIL import Image, ImageOps
import matplotlib.pyplot as plt
import keras as keras
import keras
from keras import layers
import tensorflow as tf

@ -37,7 +37,7 @@ processing, speech, and so on.
"""
import numpy as np
import keras as keras
import keras
import matplotlib.pyplot as plt
from keras import layers

@ -43,7 +43,7 @@ pip install -U tensorflow-addons
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from keras import layers
"""

@ -22,7 +22,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras as keras
import keras
from keras import layers
import matplotlib.pyplot as plt

@ -77,7 +77,7 @@ import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_datasets as tfds
import keras as keras
import keras
from keras import layers
"""

@ -40,7 +40,7 @@ import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import keras as keras
import keras
from keras import layers

@ -51,7 +51,7 @@ os.environ['KERAS_BACKEND'] = 'tensorflow'
from keras import layers
from keras import regularizers
import keras as keras
import keras
import tensorflow as tf
import matplotlib.pyplot as plt

@ -29,7 +29,7 @@ This example requires TensorFlow 2.5 or higher.
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from keras import layers
"""

@ -26,7 +26,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import keras as keras
import keras
import numpy as np

@ -49,7 +49,7 @@ from glob import glob
from PIL import Image, ImageOps
import matplotlib.pyplot as plt
import keras as keras
import keras
from keras import layers
import tensorflow as tf

@ -20,7 +20,7 @@ autoencoder model to detect anomalies in timeseries data.
import numpy as np
import pandas as pd
import keras as keras
import keras
from keras import layers
from matplotlib import pyplot as plt

@ -19,7 +19,7 @@ CSV timeseries files on disk. We demonstrate the workflow on the FordA dataset f
## Setup
"""
import keras as keras
import keras
import numpy as np
import matplotlib.pyplot as plt

@ -62,7 +62,7 @@ You can replace your classification RNN layers with this one: the
inputs are fully compatible!
"""
import keras as keras
import keras
from keras import layers
"""

@ -54,7 +54,7 @@ by TensorFlow.
"""
import numpy as np
import keras as keras
import keras
from keras import layers
from keras import ops
from tqdm import tqdm

@ -40,7 +40,7 @@ code snippets from another example,
"""
from keras import layers
import keras as keras
import keras
import matplotlib.pyplot as plt
import numpy as np

@ -25,7 +25,7 @@ of predicting what video frames come next given a series of past frames.
import numpy as np
import matplotlib.pyplot as plt
import keras as keras
import keras
from keras import layers
import io

@ -32,7 +32,7 @@ This dataset can be used for the "human part segmentation" task.
"""
import keras as keras
import keras
from keras import layers
from keras import ops

@ -25,7 +25,7 @@ implicitly considers the correlations between all samples.
## Setup
"""
import keras as keras
import keras
from keras import layers
from keras import ops

@ -27,7 +27,7 @@ to fix this discrepancy.
## Imports
"""
import keras as keras
import keras
from keras import layers
import tensorflow as tf # just for image processing and pipeline

@ -34,7 +34,7 @@ pip install tensorflow-datasets
from time import time
import keras as keras
import keras
from keras import layers
from keras.optimizers import RMSprop
from keras import ops

@ -27,7 +27,7 @@ import os
os.environ["KERAS_BACKEND"] = "jax" # @param ["tensorflow", "jax", "torch"]
import keras as keras
import keras
from keras import layers
from keras import ops

@ -42,7 +42,7 @@ os.environ["KERAS_BACKEND"] = "jax"
import json
import math
import keras_cv
import keras as keras
import keras
from keras import ops
from keras import losses
from keras import optimizers

@ -58,7 +58,7 @@ unzip -qq ~/stanfordextra_v12.zip
## Imports
"""
from keras import layers
import keras as keras
import keras
from imgaug.augmentables.kps import KeypointsOnImage
from imgaug.augmentables.kps import Keypoint

@ -40,7 +40,7 @@ using the [DenseNet-121](https://arxiv.org/abs/1608.06993) architecture.
"""
from keras import layers
import keras as keras
import keras
from keras import ops
from tensorflow import data as tf_data

@ -29,7 +29,7 @@ main building blocks.
"""
import numpy as np
import keras as keras
import keras
from keras import layers
"""

@ -12,7 +12,7 @@ Accelerator: GPU
"""
import numpy as np
import keras as keras
import keras
from keras import layers
"""

@ -43,7 +43,7 @@ os.environ["KERAS_BACKEND"] = "jax" # @param ["tensorflow", "jax", "torch"]
import numpy as np
import keras as keras
import keras
from keras import layers
from keras import ops
import matplotlib.pyplot as plt

@ -72,7 +72,7 @@ display(img)
## Prepare dataset to load & vectorize batches of data
"""
import keras as keras
import keras
import numpy as np
from tensorflow import data as tf_data
from tensorflow import image as tf_image

@ -26,7 +26,7 @@ the class segmentation of the training inputs.
import random
import numpy as np
import keras as keras
import keras
from keras import ops
import matplotlib.pyplot as plt

@ -26,7 +26,7 @@ dataset,
## Setup
"""
import keras as keras
import keras
from keras import layers
from keras import ops
from keras.utils import load_img

@ -49,7 +49,7 @@ references:
## Imports
"""
import keras as keras
import keras
from keras import layers
from keras import ops
from tensorflow import data as tf_data

@ -47,7 +47,7 @@ import os
os.environ["KERAS_BACKEND"] = "jax" # @param ["tensorflow", "jax", "torch"]
import keras as keras
import keras
from keras import layers
from keras.applications.densenet import DenseNet121

@ -48,7 +48,7 @@ import os
os.environ["KERAS_BACKEND"] = "jax"
import jax
import keras as keras
import keras
import numpy as np
"""

@ -48,7 +48,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import tensorflow as tf
import keras as keras
import keras
from keras import layers
import numpy as np

@ -48,7 +48,7 @@ import os
os.environ["KERAS_BACKEND"] = "torch"
import torch
import keras as keras
import keras
from keras import layers
import numpy as np

@ -46,7 +46,7 @@ os.environ["KERAS_BACKEND"] = "jax"
import jax
import numpy as np
import tensorflow as tf
import keras as keras
import keras
from jax.experimental import mesh_utils
from jax.sharding import Mesh

@ -42,7 +42,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import tensorflow as tf
import keras as keras
import keras
"""
## Single-host, multi-device synchronous training

@ -46,7 +46,7 @@ os.environ["KERAS_BACKEND"] = "torch"
import torch
import numpy as np
import keras as keras
import keras
def get_model():

@ -11,7 +11,7 @@ Accelerator: GPU
"""
import numpy as np
import keras as keras
import keras
from keras import layers
from keras import ops

@ -29,7 +29,7 @@ Let's dive in.
"""
import numpy as np
import keras as keras
import keras
from keras import ops
from keras import layers

@ -11,7 +11,7 @@ Accelerator: GPU
"""
import keras as keras
import keras
from keras import layers
from keras import ops

@ -17,7 +17,7 @@ import tensorflow as tf
import os
import numpy as np
import keras as keras
import keras
from keras import layers
from keras import ops

@ -11,7 +11,7 @@ Accelerator: GPU
"""
import numpy as np
import keras as keras
import keras
from keras import layers
import tensorflow_datasets as tfds
import matplotlib.pyplot as plt

@ -10,7 +10,7 @@ Accelerator: None
## Setup
"""
import numpy as np
import keras as keras
import keras
from keras import ops
from keras import layers

@ -19,7 +19,7 @@ import jax
# We import TF so we can use tf.data.
import tensorflow as tf
import keras as keras
import keras
import numpy as np
"""

@ -17,7 +17,7 @@ import os
os.environ["KERAS_BACKEND"] = "tensorflow"
import tensorflow as tf
import keras as keras
import keras
import numpy as np
"""

@ -16,7 +16,7 @@ import os
os.environ["KERAS_BACKEND"] = "torch"
import torch
import keras as keras
import keras
import numpy as np
"""

Some files were not shown because too many files have changed in this diff Show More