text stringlengths 5 261k | id stringlengths 16 106 | metadata dict | __index_level_0__ int64 0 266 |
|---|---|---|---|
class DataAdapter(object):
"""Base class for input data adapters.
The purpose of a DataAdapter is to provide a unfied interface to
iterate over input data provided in a variety of formats -- such as
NumPy arrays, tf.Tensors, tf.data.Datasets, Keras PyDatasets, etc.
"""
def get_numpy_iterator(s... | keras/keras/trainers/data_adapters/data_adapter.py/0 | {
"file_path": "keras/keras/trainers/data_adapters/data_adapter.py",
"repo_id": "keras",
"token_count": 1169
} | 200 |
import numpy as np
from keras.api_export import keras_export
from keras.utils import dataset_utils
from keras.utils.module_utils import tensorflow as tf
from keras.utils.module_utils import tensorflow_io as tfio
ALLOWED_FORMATS = (".wav",)
@keras_export("keras.utils.audio_dataset_from_directory")
def audio_dataset_... | keras/keras/utils/audio_dataset_utils.py/0 | {
"file_path": "keras/keras/utils/audio_dataset_utils.py",
"repo_id": "keras",
"token_count": 6200
} | 201 |
from keras import backend
def is_in_jax_tracing_scope(x=None):
if backend.backend() == "jax":
if x is None:
x = backend.numpy.ones(())
if x.__class__.__name__ == "DynamicJaxprTracer":
return True
return False
| keras/keras/utils/jax_utils.py/0 | {
"file_path": "keras/keras/utils/jax_utils.py",
"repo_id": "keras",
"token_count": 122
} | 202 |
import math
import re
import shutil
import rich
import rich.console
import rich.markup
# See https://github.com/keras-team/keras/issues/448
# for below imports
import rich.table
import tree
from keras import backend
from keras.utils import dtype_utils
from keras.utils import io_utils
def count_params(weights):
... | keras/keras/utils/summary_utils.py/0 | {
"file_path": "keras/keras/utils/summary_utils.py",
"repo_id": "keras",
"token_count": 6292
} | 203 |
#!/bin/bash
isort --sl tf_keras
black --line-length 80 tf_keras
flake8 tf_keras
| tf-keras/shell/format.sh/0 | {
"file_path": "tf-keras/shell/format.sh",
"repo_id": "tf-keras",
"token_count": 33
} | 204 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/applications/applications_load_weight_test.py/0 | {
"file_path": "tf-keras/tf_keras/applications/applications_load_weight_test.py",
"repo_id": "tf-keras",
"token_count": 3245
} | 205 |
# Copyright 2022 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 applica... | tf-keras/tf_keras/applications/resnet_rs.py/0 | {
"file_path": "tf-keras/tf_keras/applications/resnet_rs.py",
"repo_id": "tf-keras",
"token_count": 15247
} | 206 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/benchmarks/keras_cpu_benchmark_test.py/0 | {
"file_path": "tf-keras/tf_keras/benchmarks/keras_cpu_benchmark_test.py",
"repo_id": "tf-keras",
"token_count": 2425
} | 207 |
# Copyright 2021 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 applica... | tf-keras/tf_keras/benchmarks/metrics_memory_benchmark_test.py/0 | {
"file_path": "tf-keras/tf_keras/benchmarks/metrics_memory_benchmark_test.py",
"repo_id": "tf-keras",
"token_count": 1146
} | 208 |
# 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 applica... | tf-keras/tf_keras/callbacks_v1.py/0 | {
"file_path": "tf-keras/tf_keras/callbacks_v1.py",
"repo_id": "tf-keras",
"token_count": 10754
} | 209 |
# Copyright 2018 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 applica... | tf-keras/tf_keras/distribute/distributed_training_utils_v1.py/0 | {
"file_path": "tf-keras/tf_keras/distribute/distributed_training_utils_v1.py",
"repo_id": "tf-keras",
"token_count": 19084
} | 210 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/distribute/model_checkpoint_test.py/0 | {
"file_path": "tf-keras/tf_keras/distribute/model_checkpoint_test.py",
"repo_id": "tf-keras",
"token_count": 894
} | 211 |
# Copyright 2022 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 applica... | tf-keras/tf_keras/dtensor/test_util.py/0 | {
"file_path": "tf-keras/tf_keras/dtensor/test_util.py",
"repo_id": "tf-keras",
"token_count": 1853
} | 212 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/engine/data_adapter.py/0 | {
"file_path": "tf-keras/tf_keras/engine/data_adapter.py",
"repo_id": "tf-keras",
"token_count": 32032
} | 213 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/engine/partial_batch_padding_handler.py/0 | {
"file_path": "tf-keras/tf_keras/engine/partial_batch_padding_handler.py",
"repo_id": "tf-keras",
"token_count": 1853
} | 214 |
# Copyright 2016 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 applica... | tf-keras/tf_keras/engine/training_test.py/0 | {
"file_path": "tf-keras/tf_keras/engine/training_test.py",
"repo_id": "tf-keras",
"token_count": 98776
} | 215 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/feature_column/dense_features_v2.py/0 | {
"file_path": "tf-keras/tf_keras/feature_column/dense_features_v2.py",
"repo_id": "tf-keras",
"token_count": 2315
} | 216 |
# Copyright 2021 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 applica... | tf-keras/tf_keras/integration_test/distributed_training_test.py/0 | {
"file_path": "tf-keras/tf_keras/integration_test/distributed_training_test.py",
"repo_id": "tf-keras",
"token_count": 2125
} | 217 |
"""Model where almost everything is implemented from scratch.
- Custom layers
- Custom model subclass
- Custom train_step and test_step
- Custom compile()
- Custom learning rate schedule
- Custom metrics
"""
import tensorflow as tf
from tensorflow import keras
from tf_keras.integration_test.models.input_spec import ... | tf-keras/tf_keras/integration_test/models/low_level_model.py/0 | {
"file_path": "tf-keras/tf_keras/integration_test/models/low_level_model.py",
"repo_id": "tf-keras",
"token_count": 2096
} | 218 |
# Copyright 2021 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 applica... | tf-keras/tf_keras/integration_test/preprocessing_applied_in_dataset_test.py/0 | {
"file_path": "tf-keras/tf_keras/integration_test/preprocessing_applied_in_dataset_test.py",
"repo_id": "tf-keras",
"token_count": 906
} | 219 |
# Copyright 2016 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 applica... | tf-keras/tf_keras/layers/__init__.py/0 | {
"file_path": "tf-keras/tf_keras/layers/__init__.py",
"repo_id": "tf-keras",
"token_count": 4901
} | 220 |
# 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 applica... | tf-keras/tf_keras/layers/core/dense.py/0 | {
"file_path": "tf-keras/tf_keras/layers/core/dense.py",
"repo_id": "tf-keras",
"token_count": 5705
} | 221 |
"""Test for dynamic_lookup layer."""
import os
import shutil
import tempfile
import numpy as np
import tensorflow as tf
import tf_keras as keras
from tf_keras.layers.experimental import dynamic_lookup
from tf_keras.testing_infra import test_combinations
from tf_keras.testing_infra import test_utils
@test_utils.run... | tf-keras/tf_keras/layers/experimental/dynamic_lookup_test.py/0 | {
"file_path": "tf-keras/tf_keras/layers/experimental/dynamic_lookup_test.py",
"repo_id": "tf-keras",
"token_count": 4679
} | 222 |
# 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 applica... | tf-keras/tf_keras/layers/merging/dot.py/0 | {
"file_path": "tf-keras/tf_keras/layers/merging/dot.py",
"repo_id": "tf-keras",
"token_count": 3964
} | 223 |
# Copyright 2016 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 applica... | tf-keras/tf_keras/layers/normalization/layer_normalization_test.py/0 | {
"file_path": "tf-keras/tf_keras/layers/normalization/layer_normalization_test.py",
"repo_id": "tf-keras",
"token_count": 7991
} | 224 |
# 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 applica... | tf-keras/tf_keras/layers/pooling/base_pooling3d.py/0 | {
"file_path": "tf-keras/tf_keras/layers/pooling/base_pooling3d.py",
"repo_id": "tf-keras",
"token_count": 2175
} | 225 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/layers/preprocessing/benchmarks/hashing_benchmark.py/0 | {
"file_path": "tf-keras/tf_keras/layers/preprocessing/benchmarks/hashing_benchmark.py",
"repo_id": "tf-keras",
"token_count": 1575
} | 226 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/layers/preprocessing/hashing_test.py/0 | {
"file_path": "tf-keras/tf_keras/layers/preprocessing/hashing_test.py",
"repo_id": "tf-keras",
"token_count": 8847
} | 227 |
# Copyright 2021 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 applica... | tf-keras/tf_keras/layers/preprocessing/preprocessing_utils.py/0 | {
"file_path": "tf-keras/tf_keras/layers/preprocessing/preprocessing_utils.py",
"repo_id": "tf-keras",
"token_count": 2186
} | 228 |
# Copyright 2016 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 applica... | tf-keras/tf_keras/layers/regularization/gaussian_dropout_test.py/0 | {
"file_path": "tf-keras/tf_keras/layers/regularization/gaussian_dropout_test.py",
"repo_id": "tf-keras",
"token_count": 769
} | 229 |
# 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 applica... | tf-keras/tf_keras/layers/rnn/base_conv_lstm.py/0 | {
"file_path": "tf-keras/tf_keras/layers/rnn/base_conv_lstm.py",
"repo_id": "tf-keras",
"token_count": 11005
} | 230 |
# Copyright 2018 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 applica... | tf-keras/tf_keras/layers/rnn/cudnn_lstm.py/0 | {
"file_path": "tf-keras/tf_keras/layers/rnn/cudnn_lstm.py",
"repo_id": "tf-keras",
"token_count": 4596
} | 231 |
# 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 applica... | tf-keras/tf_keras/layers/rnn/rnn_utils.py/0 | {
"file_path": "tf-keras/tf_keras/layers/rnn/rnn_utils.py",
"repo_id": "tf-keras",
"token_count": 2868
} | 232 |
# 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 applica... | tf-keras/tf_keras/legacy_tf_layers/core.py/0 | {
"file_path": "tf-keras/tf_keras/legacy_tf_layers/core.py",
"repo_id": "tf-keras",
"token_count": 7134
} | 233 |
# 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 applica... | tf-keras/tf_keras/metrics/base_metric.py/0 | {
"file_path": "tf-keras/tf_keras/metrics/base_metric.py",
"repo_id": "tf-keras",
"token_count": 16026
} | 234 |
# 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 applica... | tf-keras/tf_keras/metrics/regression_metrics.py/0 | {
"file_path": "tf-keras/tf_keras/metrics/regression_metrics.py",
"repo_id": "tf-keras",
"token_count": 9462
} | 235 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/mixed_precision/test_util.py/0 | {
"file_path": "tf-keras/tf_keras/mixed_precision/test_util.py",
"repo_id": "tf-keras",
"token_count": 3427
} | 236 |
tf_keras/api/tests/API_UPDATE_WARNING.txt:
tf_keras/api/tests/README.txt:
tf_keras/benchmarks/layer_benchmarks/run_xprof.py:
| tf-keras/tf_keras/opensource_only.files/0 | {
"file_path": "tf-keras/tf_keras/opensource_only.files",
"repo_id": "tf-keras",
"token_count": 54
} | 237 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/optimizers/legacy/adam.py/0 | {
"file_path": "tf-keras/tf_keras/optimizers/legacy/adam.py",
"repo_id": "tf-keras",
"token_count": 10024
} | 238 |
# Copyright 2023 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 applica... | tf-keras/tf_keras/optimizers/lion.py/0 | {
"file_path": "tf-keras/tf_keras/optimizers/lion.py",
"repo_id": "tf-keras",
"token_count": 2686
} | 239 |
/* Copyright 2020 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 a... | tf-keras/tf_keras/protobuf/versions.proto/0 | {
"file_path": "tf-keras/tf_keras/protobuf/versions.proto",
"repo_id": "tf-keras",
"token_count": 499
} | 240 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/saving/legacy/saved_model/base_serialization.py/0 | {
"file_path": "tf-keras/tf_keras/saving/legacy/saved_model/base_serialization.py",
"repo_id": "tf-keras",
"token_count": 1736
} | 241 |
# Copyright 2018 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 applica... | tf-keras/tf_keras/saving/legacy/saved_model/serialized_attributes.py/0 | {
"file_path": "tf-keras/tf_keras/saving/legacy/saved_model/serialized_attributes.py",
"repo_id": "tf-keras",
"token_count": 5812
} | 242 |
# Copyright 2022 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 applica... | tf-keras/tf_keras/testing_infra/keras_doctest_lib.py/0 | {
"file_path": "tf-keras/tf_keras/testing_infra/keras_doctest_lib.py",
"repo_id": "tf-keras",
"token_count": 3588
} | 243 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/tests/memory_checker_test.py/0 | {
"file_path": "tf-keras/tf_keras/tests/memory_checker_test.py",
"repo_id": "tf-keras",
"token_count": 1212
} | 244 |
#!/bin/bash
BAZEL_VERSION=5.4.0
rm -rf ~/bazel
mkdir ~/bazel
pushd ~/bazel
wget https://github.com/bazelbuild/bazel/releases/download/"${BAZEL_VERSION}"/bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh
chmod +x bazel-*.sh
./bazel-"${BAZEL_VERSION}"-installer-linux-x86_64.sh --user
rm bazel-"${BAZEL_VERSION}"-install... | tf-keras/tf_keras/tools/bazel_build.sh/0 | {
"file_path": "tf-keras/tf_keras/tools/bazel_build.sh",
"repo_id": "tf-keras",
"token_count": 274
} | 245 |
# Copyright 2018 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 applica... | tf-keras/tf_keras/utils/data_utils.py/0 | {
"file_path": "tf-keras/tf_keras/utils/data_utils.py",
"repo_id": "tf-keras",
"token_count": 16873
} | 246 |
# Copyright 2020 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 applica... | tf-keras/tf_keras/utils/sidecar_evaluator_test.py/0 | {
"file_path": "tf-keras/tf_keras/utils/sidecar_evaluator_test.py",
"repo_id": "tf-keras",
"token_count": 7803
} | 247 |
# Copyright 2019 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 applica... | tf-keras/tf_keras/utils/version_utils_test.py/0 | {
"file_path": "tf-keras/tf_keras/utils/version_utils_test.py",
"repo_id": "tf-keras",
"token_count": 2573
} | 248 |
.git
.github
*.Dockerfile
| autokeras/.dockerignore/0 | {
"file_path": "autokeras/.dockerignore",
"repo_id": "autokeras",
"token_count": 11
} | 0 |
# Copyright 2020 The AutoKeras 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | autokeras/autokeras/analysers/input_analysers.py/0 | {
"file_path": "autokeras/autokeras/analysers/input_analysers.py",
"repo_id": "autokeras",
"token_count": 2665
} | 1 |
# Copyright 2020 The AutoKeras 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | autokeras/autokeras/blocks/wrapper_test.py/0 | {
"file_path": "autokeras/autokeras/blocks/wrapper_test.py",
"repo_id": "autokeras",
"token_count": 2177
} | 2 |
# Copyright 2020 The AutoKeras 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | autokeras/autokeras/engine/serializable.py/0 | {
"file_path": "autokeras/autokeras/engine/serializable.py",
"repo_id": "autokeras",
"token_count": 354
} | 3 |
# Copyright 2020 The AutoKeras 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | autokeras/autokeras/pipeline_test.py/0 | {
"file_path": "autokeras/autokeras/pipeline_test.py",
"repo_id": "autokeras",
"token_count": 517
} | 4 |
# Copyright 2020 The AutoKeras 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | autokeras/autokeras/tuners/greedy_test.py/0 | {
"file_path": "autokeras/autokeras/tuners/greedy_test.py",
"repo_id": "autokeras",
"token_count": 1501
} | 5 |
# Copyright 2020 The AutoKeras 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | autokeras/autokeras/utils/utils_test.py/0 | {
"file_path": "autokeras/autokeras/utils/utils_test.py",
"repo_id": "autokeras",
"token_count": 1098
} | 6 |
from subprocess import CalledProcessError
from subprocess import check_call
def check_bash_call(string):
check_call(["bash", "-c", string])
def _run_format_and_flake8():
files_changed = False
try:
check_bash_call("sh shell/lint.sh")
except CalledProcessError:
check_bash_call("sh she... | autokeras/docker/pre_commit.py/0 | {
"file_path": "autokeras/docker/pre_commit.py",
"repo_id": "autokeras",
"token_count": 329
} | 7 |
import itertools
import re
from sphinx.util.typing import stringify
from . import utils
def get_code_blocks(docstring):
code_blocks = {}
tmp = docstring[:]
while "```" in tmp:
tmp = tmp[tmp.find("```") :]
index = tmp[3:].find("```") + 6
snippet = tmp[:index]
# Place marke... | autokeras/docs/keras_autodoc/docstring.py/0 | {
"file_path": "autokeras/docs/keras_autodoc/docstring.py",
"repo_id": "autokeras",
"token_count": 1739
} | 8 |
## How to resume a previously killed run?
This feature is controlled by the `overwrite` argument of `AutoModel` or any other task APIs.
It is set to `False` by default,
which means it would not overwrite the contents of the directory.
In other words, it will continue the previous fit.
You can just run the same code ag... | autokeras/docs/templates/tutorial/faq.md/0 | {
"file_path": "autokeras/docs/templates/tutorial/faq.md",
"repo_id": "autokeras",
"token_count": 729
} | 9 |
import base64
import json
import os
import sys
from io import BytesIO
import requests
from PIL import Image
def main(directory):
contributors = []
for contributor in json.load(open("contributors.json")):
if contributor["type"] != "User":
continue
if contributor["login"] == "codacy... | autokeras/shell/contributors.py/0 | {
"file_path": "autokeras/shell/contributors.py",
"repo_id": "autokeras",
"token_count": 1078
} | 10 |
# Tune end-to-end ML workflows in KerasTuner
| Status | Proposed |
:-------------- |:---------------------------------------------------- |
| **Author** | Haifeng Jin (haifengj@google.com) |
| **Updated** | 2021-09-20 ... | governance/rfcs/20210920-tune-end-to-end-ml-workflows-in-keras-tuner.md/0 | {
"file_path": "governance/rfcs/20210920-tune-end-to-end-ml-workflows-in-keras-tuner.md",
"repo_id": "governance",
"token_count": 6737
} | 11 |
"""ResNet50 model for Keras.
# Reference:
- [Deep Residual Learning for Image Recognition](
https://arxiv.org/abs/1512.03385) (CVPR 2016 Best Paper Award)
Adapted from code contributed by BigMoyan.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
i... | keras-applications/keras_applications/resnet50.py/0 | {
"file_path": "keras-applications/keras_applications/resnet50.py",
"repo_id": "keras-applications",
"token_count": 5470
} | 12 |
# Keras-contrib Documentation
The source for Keras-contrib documentation is in this directory under `sources/`.
Our documentation uses extended Markdown, as implemented by [MkDocs](http://mkdocs.org).
## Building the documentation
- install pydoc-markdown: `pip install pydoc-markdown`
- `cd` to the `contrib_docs/` ... | keras-contrib/contrib_docs/README.md/0 | {
"file_path": "keras-contrib/contrib_docs/README.md",
"repo_id": "keras-contrib",
"token_count": 158
} | 13 |
<div class="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
{% if config.repo_name == 'GitHub' %}
<a href="{{ config.repo_url }}" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
{% elif config.repo_name ... | keras-contrib/contrib_docs/theme/versions.html/0 | {
"file_path": "keras-contrib/contrib_docs/theme/versions.html",
"repo_id": "keras-contrib",
"token_count": 449
} | 14 |
# -*- coding: utf-8 -*-
'''DenseNet and DenseNet-FCN models for Keras.
DenseNet is a network architecture where each layer is directly connected
to every other layer in a feed-forward fashion (within each dense block).
For each layer, the feature maps of all preceding layers are treated as
separate inputs whereas its ... | keras-contrib/keras_contrib/applications/densenet.py/0 | {
"file_path": "keras-contrib/keras_contrib/applications/densenet.py",
"repo_id": "keras-contrib",
"token_count": 25010
} | 15 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from keras import backend as K
from keras import activations
from keras import initializers
from keras import regularizers
from keras import constraints
from keras.layers import InputSpec
from keras.layers import Layer
from ... | keras-contrib/keras_contrib/layers/core.py/0 | {
"file_path": "keras-contrib/keras_contrib/layers/core.py",
"repo_id": "keras-contrib",
"token_count": 3398
} | 16 |
from keras_contrib import activations
import keras.backend as K
import numpy as np
from numpy.testing import assert_allclose
def get_standard_values():
"""A set of floats used for testing squash.
"""
return np.array([[0, 0.1, 0.5, 0.9, 1.0]], dtype=K.floatx())
def test_squash_valid():
"""Test using ... | keras-contrib/tests/keras_contrib/activations/test_squash.py/0 | {
"file_path": "keras-contrib/tests/keras_contrib/activations/test_squash.py",
"repo_id": "keras-contrib",
"token_count": 331
} | 17 |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from keras_contrib.utils.test_utils import layer_test
from keras_contrib.utils.test_utils import is_tf_keras
from keras import backend as K
from keras_contrib.layers import capsule
from keras.models import Sequential
@pytest.mark.parametrize(... | keras-contrib/tests/keras_contrib/layers/test_capsule.py/0 | {
"file_path": "keras-contrib/tests/keras_contrib/layers/test_capsule.py",
"repo_id": "keras-contrib",
"token_count": 767
} | 18 |
import importlib
import inspect
import re
import sys
from itertools import compress
import pytest
modules = ['keras_contrib.layers',
'keras_contrib',
'keras_contrib.backend.tensorflow_backend',
'keras_contrib.wrappers',
'keras_contrib.utils',
'keras_contrib.callb... | keras-contrib/tests/tooling/test_documentation.py/0 | {
"file_path": "keras-contrib/tests/tooling/test_documentation.py",
"repo_id": "keras-contrib",
"token_count": 2548
} | 19 |
"""Benchmark BERT model on GLUE/MRPC task.
To run the script, make sure you are in benchmarks/ directory, abd run the
command below:
```
python3 -m model_benchmark.bert_benchmark \
--epochs 2 \
--batch_size 32
```
"""
import time
import keras_nlp
import numpy as np
import tensorflow as tf
import tensorflow_... | keras-core/benchmarks/model_benchmark/bert_benchmark.py/0 | {
"file_path": "keras-core/benchmarks/model_benchmark/bert_benchmark.py",
"repo_id": "keras-core",
"token_count": 1984
} | 20 |
import numpy as np
from keras_core import Model
from keras_core import layers
from keras_core import losses
from keras_core import metrics
from keras_core import optimizers
class MyModel(Model):
def __init__(self, hidden_dim, output_dim):
super().__init__()
self.dense1 = layers.Dense(hidden_dim, ... | keras-core/examples/demo_subclass.py/0 | {
"file_path": "keras-core/examples/demo_subclass.py",
"repo_id": "keras-core",
"token_count": 412
} | 21 |
"""
Title: CycleGAN
Author: [A_K_Nain](https://twitter.com/A_K_Nain)
Date created: 2020/08/12
Last modified: 2020/08/12
Description: Implementation of CycleGAN.
Accelerator: GPU
"""
"""
## CycleGAN
CycleGAN is a model that aims to solve the image-to-image translation
problem. The goal of the image-to-image translatio... | keras-core/examples/keras_io/tensorflow/generative/cyclegan.py/0 | {
"file_path": "keras-core/examples/keras_io/tensorflow/generative/cyclegan.py",
"repo_id": "keras-core",
"token_count": 8834
} | 22 |
"""
Title: Character-level recurrent sequence-to-sequence model
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2017/09/29
Last modified: 2020/04/26
Description: Character-level recurrent sequence-to-sequence model.
Accelerator: GPU
"""
"""
## Introduction
This example demonstrates how to implement a ba... | keras-core/examples/keras_io/tensorflow/nlp/lstm_seq2seq.py/0 | {
"file_path": "keras-core/examples/keras_io/tensorflow/nlp/lstm_seq2seq.py",
"repo_id": "keras-core",
"token_count": 3631
} | 23 |
"""
Title: Timeseries anomaly detection using an Autoencoder
Author: [pavithrasv](https://github.com/pavithrasv)
Date created: 2020/05/31
Last modified: 2020/05/31
Description: Detect anomalies in a timeseries using an Autoencoder.
Accelerator: GPU
"""
"""
## Introduction
This script demonstrates how you can use a re... | keras-core/examples/keras_io/timeseries/timeseries_anomaly_detection.py/0 | {
"file_path": "keras-core/examples/keras_io/timeseries/timeseries_anomaly_detection.py",
"repo_id": "keras-core",
"token_count": 3054
} | 24 |
"""
Title: Simple MNIST convnet
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2015/06/19
Last modified: 2020/04/21
Description: A simple convnet that achieves ~99% test accuracy on MNIST.
Accelerator: GPU
"""
"""
## Setup
"""
import numpy as np
import keras_core as keras
from keras_core import layers... | keras-core/examples/keras_io/vision/mnist_convnet.py/0 | {
"file_path": "keras-core/examples/keras_io/vision/mnist_convnet.py",
"repo_id": "keras-core",
"token_count": 766
} | 25 |
"""
Title: Transfer learning & fine-tuning
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2020/04/15
Last modified: 2023/06/25
Description: Complete guide to transfer learning & fine-tuning in Keras.
Accelerator: GPU
"""
"""
## Setup
"""
import numpy as np
import keras_core as keras
from keras_core imp... | keras-core/guides/transfer_learning.py/0 | {
"file_path": "keras-core/guides/transfer_learning.py",
"repo_id": "keras-core",
"token_count": 6061
} | 26 |
from keras_core import backend
from keras_core import layers
from keras_core.api_export import keras_core_export
from keras_core.applications import imagenet_utils
from keras_core.models import Functional
from keras_core.ops import operation_utils
from keras_core.utils import file_utils
WEIGHTS_PATH = (
"https://s... | keras-core/keras_core/applications/vgg16.py/0 | {
"file_path": "keras-core/keras_core/applications/vgg16.py",
"repo_id": "keras-core",
"token_count": 4022
} | 27 |
import numpy as np
from keras_core.api_export import keras_core_export
from keras_core.backend import config
from keras_core.backend.common import global_state
from keras_core.backend.common.name_scope import current_path
from keras_core.backend.common.stateless_scope import get_stateless_scope
from keras_core.backend... | keras-core/keras_core/backend/common/variables.py/0 | {
"file_path": "keras-core/keras_core/backend/common/variables.py",
"repo_id": "keras-core",
"token_count": 7664
} | 28 |
import numpy as np
import tree
from keras_core.backend.common import KerasVariable
from keras_core.backend.common import standardize_dtype
from keras_core.backend.common.keras_tensor import KerasTensor
from keras_core.backend.common.stateless_scope import StatelessScope
from keras_core.utils.nest import pack_sequence_... | keras-core/keras_core/backend/numpy/core.py/0 | {
"file_path": "keras-core/keras_core/backend/numpy/core.py",
"repo_id": "keras-core",
"token_count": 2827
} | 29 |
import warnings
import tensorflow as tf
from keras_core.backend import standardize_data_format
from keras_core.backend import standardize_dtype
from keras_core.backend.common.backend_utils import (
compute_conv_transpose_output_shape,
)
from keras_core.backend.config import epsilon
from keras_core.backend.tensorf... | keras-core/keras_core/backend/tensorflow/nn.py/0 | {
"file_path": "keras-core/keras_core/backend/tensorflow/nn.py",
"repo_id": "keras-core",
"token_count": 9582
} | 30 |
import numpy as np
import torch
from keras_core.backend import config
from keras_core.backend.torch.core import cast
from keras_core.backend.torch.core import convert_to_tensor
from keras_core.backend.torch.core import get_device
from keras_core.backend.torch.core import is_tensor
from keras_core.backend.torch.core im... | keras-core/keras_core/backend/torch/numpy.py/0 | {
"file_path": "keras-core/keras_core/backend/torch/numpy.py",
"repo_id": "keras-core",
"token_count": 12808
} | 31 |
from keras_core.callbacks.backup_and_restore_callback import BackupAndRestore
from keras_core.callbacks.callback import Callback
from keras_core.callbacks.callback_list import CallbackList
from keras_core.callbacks.csv_logger import CSVLogger
from keras_core.callbacks.early_stopping import EarlyStopping
from keras_core... | keras-core/keras_core/callbacks/__init__.py/0 | {
"file_path": "keras-core/keras_core/callbacks/__init__.py",
"repo_id": "keras-core",
"token_count": 265
} | 32 |
"""Utilities common to CIFAR10 and CIFAR100 datasets."""
import _pickle as cPickle
def load_batch(fpath, label_key="labels"):
"""Internal utility for parsing CIFAR data.
Args:
fpath: path the file to parse.
label_key: key for label data in the retrieve
dictionary.
Returns:
... | keras-core/keras_core/datasets/cifar.py/0 | {
"file_path": "keras-core/keras_core/datasets/cifar.py",
"repo_id": "keras-core",
"token_count": 322
} | 33 |
from keras_core.api_export import keras_core_export
@keras_core_export(
["keras_core.Initializer", "keras_core.initializers.Initializer"]
)
class Initializer:
"""Initializer base class: all Keras initializers inherit from this class.
Initializers should implement a `__call__()` method with the following
... | keras-core/keras_core/initializers/initializer.py/0 | {
"file_path": "keras-core/keras_core/initializers/initializer.py",
"repo_id": "keras-core",
"token_count": 1022
} | 34 |
import numpy as np
import pytest
from keras_core import testing
from keras_core.layers.activations import softmax
class SoftmaxTest(testing.TestCase):
@pytest.mark.requires_trainable_backend
def test_softmax(self):
self.run_layer_test(
softmax.Softmax,
init_kwargs={},
... | keras-core/keras_core/layers/activations/softmax_test.py/0 | {
"file_path": "keras-core/keras_core/layers/activations/softmax_test.py",
"repo_id": "keras-core",
"token_count": 887
} | 35 |
from keras_core.api_export import keras_core_export
from keras_core.layers.convolutional.base_conv_transpose import (
BaseConvTranspose,
)
@keras_core_export(
[
"keras_core.layers.Conv2DTranspose",
"keras_core.layers.Convolution2DTranspose",
]
)
class Conv2DTranspose(BaseConvTranspose):
... | keras-core/keras_core/layers/convolutional/conv2d_transpose.py/0 | {
"file_path": "keras-core/keras_core/layers/convolutional/conv2d_transpose.py",
"repo_id": "keras-core",
"token_count": 2313
} | 36 |
from keras_core import constraints
from keras_core import initializers
from keras_core import ops
from keras_core import regularizers
from keras_core.api_export import keras_core_export
from keras_core.layers.layer import Layer
@keras_core_export("keras_core.layers.Embedding")
class Embedding(Layer):
"""Turns pos... | keras-core/keras_core/layers/core/embedding.py/0 | {
"file_path": "keras-core/keras_core/layers/core/embedding.py",
"repo_id": "keras-core",
"token_count": 2010
} | 37 |
from keras_core import ops
from keras_core.api_export import keras_core_export
from keras_core.layers.merging.base_merge import Merge
@keras_core_export("keras_core.layers.Add")
class Add(Merge):
"""Performs elementwise addition operation.
It takes as input a list of tensors, all of the same shape,
and r... | keras-core/keras_core/layers/merging/add.py/0 | {
"file_path": "keras-core/keras_core/layers/merging/add.py",
"repo_id": "keras-core",
"token_count": 934
} | 38 |
import numpy as np
import pytest
from keras_core import layers
from keras_core import ops
from keras_core import regularizers
from keras_core import testing
class LayerNormalizationTest(testing.TestCase):
@pytest.mark.requires_trainable_backend
def test_ln_basics(self):
self.run_layer_test(
... | keras-core/keras_core/layers/normalization/layer_normalization_test.py/0 | {
"file_path": "keras-core/keras_core/layers/normalization/layer_normalization_test.py",
"repo_id": "keras-core",
"token_count": 2315
} | 39 |
import os
import pytest
from tensorflow import data as tf_data
from keras_core import backend
from keras_core import layers
from keras_core import models
from keras_core import ops
from keras_core import testing
from keras_core.layers.preprocessing import feature_space
from keras_core.saving import saving_api
class... | keras-core/keras_core/layers/preprocessing/feature_space_test.py/0 | {
"file_path": "keras-core/keras_core/layers/preprocessing/feature_space_test.py",
"repo_id": "keras-core",
"token_count": 11387
} | 40 |
import numpy as np
from tensorflow import data as tf_data
from keras_core import layers
from keras_core import testing
class RandomCropTest(testing.TestCase):
def test_random_crop(self):
self.run_layer_test(
layers.RandomCrop,
init_kwargs={
"height": 1,
... | keras-core/keras_core/layers/preprocessing/random_crop_test.py/0 | {
"file_path": "keras-core/keras_core/layers/preprocessing/random_crop_test.py",
"repo_id": "keras-core",
"token_count": 1205
} | 41 |
import numpy as np
import pytest
from tensorflow import data as tf_data
from keras_core import backend
from keras_core import layers
from keras_core import models
from keras_core import testing
class TextVectorizationTest(testing.TestCase):
# TODO: increase coverage. Most features aren't being tested.
def t... | keras-core/keras_core/layers/preprocessing/text_vectorization_test.py/0 | {
"file_path": "keras-core/keras_core/layers/preprocessing/text_vectorization_test.py",
"repo_id": "keras-core",
"token_count": 1776
} | 42 |
from keras_core import backend
from keras_core.api_export import keras_core_export
from keras_core.layers.input_spec import InputSpec
from keras_core.layers.layer import Layer
from keras_core.utils import argument_validation
@keras_core_export("keras_core.layers.Cropping2D")
class Cropping2D(Layer):
"""Cropping l... | keras-core/keras_core/layers/reshaping/cropping2d.py/0 | {
"file_path": "keras-core/keras_core/layers/reshaping/cropping2d.py",
"repo_id": "keras-core",
"token_count": 4702
} | 43 |
from keras_core import backend
from keras_core import ops
from keras_core.api_export import keras_core_export
from keras_core.layers.input_spec import InputSpec
from keras_core.layers.layer import Layer
from keras_core.utils import argument_validation
@keras_core_export("keras_core.layers.UpSampling3D")
class UpSampl... | keras-core/keras_core/layers/reshaping/up_sampling3d.py/0 | {
"file_path": "keras-core/keras_core/layers/reshaping/up_sampling3d.py",
"repo_id": "keras-core",
"token_count": 2436
} | 44 |
import numpy as np
import pytest
from keras_core import initializers
from keras_core import layers
from keras_core import ops
from keras_core import testing
class TimeDistributedTest(testing.TestCase):
@pytest.mark.requires_trainable_backend
def test_basics(self):
self.run_layer_test(
lay... | keras-core/keras_core/layers/rnn/time_distributed_test.py/0 | {
"file_path": "keras-core/keras_core/layers/rnn/time_distributed_test.py",
"repo_id": "keras-core",
"token_count": 1315
} | 45 |
"""Legacy serialization logic for Keras models."""
import contextlib
import inspect
import json
import threading
import weakref
# isort: off
from keras_core.api_export import keras_core_export
from keras_core.saving import object_registration
# Flag that determines whether to skip the NotImplementedError when calling... | keras-core/keras_core/legacy/saving/serialization.py/0 | {
"file_path": "keras-core/keras_core/legacy/saving/serialization.py",
"repo_id": "keras-core",
"token_count": 8551
} | 46 |
import numpy as np
from keras_core import testing
from keras_core.metrics import iou_metrics as metrics
class IoUTest(testing.TestCase):
def test_config(self):
obj = metrics.IoU(
num_classes=2, target_class_ids=[1, 0], name="iou_class_1_0"
)
self.assertEqual(obj.name, "iou_cla... | keras-core/keras_core/metrics/iou_metrics_test.py/0 | {
"file_path": "keras-core/keras_core/metrics/iou_metrics_test.py",
"repo_id": "keras-core",
"token_count": 9125
} | 47 |
import warnings
import numpy as np
import pytest
from keras_core import backend
from keras_core import layers
from keras_core import testing
from keras_core.layers.core.input_layer import Input
from keras_core.layers.input_spec import InputSpec
from keras_core.models import Functional
from keras_core.models import Mo... | keras-core/keras_core/models/functional_test.py/0 | {
"file_path": "keras-core/keras_core/models/functional_test.py",
"repo_id": "keras-core",
"token_count": 6177
} | 48 |
"""Commonly-used neural network operations not included in NumPy."""
from keras_core import backend
from keras_core.api_export import keras_core_export
from keras_core.backend import KerasTensor
from keras_core.backend import any_symbolic_tensors
from keras_core.backend import standardize_data_format
from keras_core.b... | keras-core/keras_core/ops/nn.py/0 | {
"file_path": "keras-core/keras_core/ops/nn.py",
"repo_id": "keras-core",
"token_count": 23621
} | 49 |
# flake8: noqa
import numpy as np
from keras_core import backend
from keras_core import testing
from keras_core.optimizers.adafactor import Adafactor
class AdafactorTest(testing.TestCase):
def test_config(self):
optimizer = Adafactor(
learning_rate=0.5,
beta_2_decay=-0.65,
... | keras-core/keras_core/optimizers/adafactor_test.py/0 | {
"file_path": "keras-core/keras_core/optimizers/adafactor_test.py",
"repo_id": "keras-core",
"token_count": 1855
} | 50 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.