Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/keras-team/keras
/ functions
Functions
14,520 in github.com/keras-team/keras
⨍
Functions
14,520
◇
Types & classes
1,698
↳
Endpoints
165
↓ 1,610 callers
Method
assertAllClose
Assert that two arrays are equal up to given tolerances. Given two array-like objects, check that their shapes and all elements are e
keras/src/testing/test_case.py:48
↓ 570 callers
Method
symbolic_call
(self, *args, **kwargs)
keras/src/ops/operation.py:83
↓ 516 callers
Function
standardize_dtype
(dtype)
keras/src/backend/common/variables.py:573
↓ 466 callers
Method
cast
Cast a tensor to a different dtype. Only called on a full array as provided by the user. Args: x: the tensor to cast.
keras/src/trainers/data_adapters/array_slicing.py:54
↓ 432 callers
Method
reshape
(self, newshape)
keras/src/backend/common/keras_tensor.py:139
↓ 415 callers
Method
output
Retrieves the output tensor(s) of a layer. Only returns the tensor(s) corresponding to the *first time* the operation was called.
keras/src/ops/operation.py:380
↓ 340 callers
Function
any_symbolic_tensors
(args=None, kwargs=None)
keras/src/backend/common/keras_tensor.py:402
↓ 338 callers
Method
append
(self, value)
keras/src/utils/tracking.py:146
↓ 336 callers
Function
get_ov_output
(x, ov_type=None, context_dtype=None)
keras/src/backend/openvino/core.py:104
↓ 306 callers
Method
get_temp_dir
(self)
keras/src/testing/test_case.py:36
↓ 305 callers
Function
convert_to_tensor
(x, dtype=None, sparse=None, ragged=None)
keras/src/backend/torch/core.py:193
↓ 236 callers
Function
convert_to_tensor
(x, dtype=None, sparse=None, ragged=None)
keras/src/backend/jax/core.py:371
↓ 235 callers
Method
shape
(self)
keras/src/backend/tensorflow/core.py:80
↓ 232 callers
Method
add
(self, n, values=None)
keras/src/utils/progbar.py:239
↓ 220 callers
Method
compile
Configures the model for training. Example: ```python model.compile( optimizer=keras.optimizers.Adam(learning_ra
keras/src/trainers/trainer.py:40
↓ 211 callers
Method
convert_to_numpy
(self, x)
keras/src/testing/test_case.py:41
↓ 210 callers
Method
sum
(x, axis)
keras/src/backend/common/thread_safe_test.py:15
↓ 205 callers
Function
convert_to_tensor
(x, dtype=None, sparse=None, ragged=None)
keras/src/backend/tensorflow/core.py:140
↓ 183 callers
Method
fit
Trains the model for a fixed number of epochs (dataset iterations). Args: x: Input data. It can be: - A NumPy arr
keras/src/trainers/trainer.py:548
↓ 182 callers
Method
map_structure
(obj)
keras/src/utils/dataset_utils_test.py:27
↓ 171 callers
Method
convert
(self, conversion_fn)
keras/src/ops/symbolic_arguments.py:26
↓ 165 callers
Function
convert_to_tensor
(x, dtype=None, sparse=None, ragged=None)
keras/src/backend/numpy/core.py:38
↓ 163 callers
Method
assertAlmostEqual
Assert that two arrays are equal up to given decimal places. Given two array-like objects, check that their shapes and all elements a
keras/src/testing/test_case.py:83
↓ 157 callers
Method
run_layer_test
Run basic checks on a layer. Args: layer_cls: The class of the layer to test. init_kwargs: Dict of arguments to be us
keras/src/testing/test_case.py:204
↓ 149 callers
Method
keys
(self)
keras/src/utils/config.py:114
↓ 147 callers
Method
concatenate
(outputs)
keras/src/backend/jax/trainer.py:214
↓ 139 callers
Method
assertLen
(self, iterable, expected_len, msg=None)
keras/src/testing/test_case.py:110
↓ 138 callers
Method
squeeze
(self, axis=None)
keras/src/backend/common/keras_tensor.py:144
↓ 130 callers
Method
items
(self)
keras/src/utils/config.py:120
↓ 129 callers
Method
numpy
(self)
keras/src/backend/tensorflow/core.py:76
↓ 109 callers
Method
assign
(self, value)
keras/src/backend/common/variables.py:282
↓ 109 callers
Method
concat
(self, x)
keras/src/backend/tensorflow/saved_model_test.py:333
↓ 107 callers
Method
assertDType
(self, x, dtype, msg=None)
keras/src/testing/test_case.py:152
↓ 99 callers
Method
update
(self, *args, **kwargs)
keras/src/utils/config.py:127
↓ 96 callers
Method
__init__
(self, axis=None, keepdims=False, *, name=None)
keras/src/ops/numpy.py:291
↓ 94 callers
Method
predict
Generates output predictions for the input samples. Computation is done in batches. This method is designed for batch processing of l
keras/src/trainers/trainer.py:845
↓ 92 callers
Method
map
(self, x)
keras/src/trainers/data_adapters/grain_dataset_adapter.py:151
↓ 87 callers
Method
pad
(self, boxes, top, left)
keras/src/layers/preprocessing/image_preprocessing/bounding_boxes/bounding_box.py:241
↓ 86 callers
Method
pop
(self, *args)
keras/src/utils/config.py:123
↓ 82 callers
Method
add_weight
Add a weight variable to the layer. Args: shape: Shape tuple for the variable. Must be fully-defined (no `None` e
keras/src/layers/layer.py:524
↓ 81 callers
Function
cast
(x, dtype)
keras/src/backend/torch/core.py:300
↓ 78 callers
Method
get
(self, keyname, value=None)
keras/src/utils/config.py:131
↓ 73 callers
Method
all
(cls)
keras/src/legacy/losses.py:12
↓ 71 callers
Method
benchmark_predict
(self, num_samples, batch_size, data=None)
benchmarks/layer_benchmark/base_benchmark.py:179
↓ 71 callers
Method
benchmark_train
(self, num_samples, batch_size, data=None, label=None)
benchmarks/layer_benchmark/base_benchmark.py:223
↓ 71 callers
Method
run_class_serialization_test
(self, instance, custom_objects=None)
keras/src/testing/test_case.py:170
↓ 70 callers
Function
Input
Used to instantiate a Keras tensor. A Keras tensor is a symbolic tensor-like object, which we augment with certain attributes that allow us t
keras/src/layers/core/input_layer.py:146
↓ 70 callers
Method
reshape
(self, new_shape)
keras/src/backend/openvino/core.py:753
↓ 66 callers
Function
get_device
()
keras/src/backend/torch/core.py:74
↓ 65 callers
Method
apply_gradients
(self, grads_and_vars)
keras/src/optimizers/base_optimizer.py:460
↓ 65 callers
Method
build
(self, input_shape)
keras/src/layers/core/dense.py:124
↓ 65 callers
Method
get
(self, unused_object_id)
keras/src/legacy/saving/serialization.py:78
↓ 64 callers
Method
result
Compute the current metric value. Returns: A scalar tensor, or a dictionary of scalar tensors.
keras/src/metrics/metric.py:146
↓ 63 callers
Method
update_state
Accumulate statistics for the metric.
keras/src/metrics/metric.py:117
↓ 55 callers
Function
canonicalize_axis
Canonicalize an axis in [-num_dims, num_dims) to [0, num_dims).
keras/src/backend/common/backend_utils.py:348
↓ 52 callers
Method
evaluate
Returns the loss value & metrics values for the model in test mode. Computation is done in batches (see the `batch_size` arg.) Args:
keras/src/trainers/trainer.py:750
↓ 50 callers
Function
cast
(x, dtype)
keras/src/backend/jax/core.py:422
↓ 50 callers
Method
squeeze
(self, axis=None)
keras/src/backend/openvino/core.py:760
↓ 49 callers
Method
load_weights
Load the weights from a single file or sharded files. Weights are loaded based on the network's topology. This means the architecture
keras/src/models/model.py:378
↓ 49 callers
Method
save
Saves a model as a `.keras` file. Note that `model.save()` is an alias for `keras.saving.save_model()`. The saved `.keras` file cont
keras/src/models/model.py:274
↓ 47 callers
Method
values
(self)
keras/src/utils/config.py:117
↓ 45 callers
Method
export
Exports the Keras model to a TFLite file. Args: filepath: Output path for the exported model Returns: Path t
keras/src/export/litert.py:98
↓ 43 callers
Function
broadcast_shapes
Broadcast input shapes to a unified shape. Convert to list for mutability. Args: shape1: A tuple or list of integers. shape2
keras/src/ops/operation_utils.py:13
↓ 43 callers
Method
quantize
(self, mode=None, type_check=True, config=None)
keras/src/layers/core/dense.py:1031
↓ 41 callers
Function
standardize_axis_for_numpy
Standardize an axis to a tuple if it is a list in the numpy backend.
keras/src/backend/common/backend_utils.py:368
↓ 40 callers
Method
__init__
(self)
keras/src/layers/layer_test.py:24
↓ 40 callers
Function
draw_seed
(seed)
keras/src/random/seed_generator.py:149
↓ 37 callers
Method
__init__
(self, alpha=1.0, *, name=None)
keras/src/ops/nn.py:547
↓ 37 callers
Method
build
(self, input_shape)
keras/src/layers/core/einsum_dense.py:180
↓ 37 callers
Method
from_config
(cls, config)
keras/src/metrics/metric.py:234
↓ 36 callers
Method
_clip_gradients
(self, grads)
keras/src/optimizers/base_optimizer.py:870
↓ 36 callers
Method
assertNotAllClose
(self, x1, x2, atol=1e-6, rtol=1e-6, msg=None)
keras/src/testing/test_case.py:73
↓ 36 callers
Method
serialize
(self)
keras/src/saving/serialization_lib.py:70
↓ 36 callers
Function
to_torch_dtype
(dtype)
keras/src/backend/torch/core.py:98
↓ 35 callers
Method
add
Adds a layer instance on top of the layer stack. Args: layer: layer instance.
keras/src/models/sequential.py:78
↓ 35 callers
Method
save
Save the `FeatureSpace` instance to a `.keras` file. You can reload it via `keras.models.load_model()`: ```python feature_sp
keras/src/layers/preprocessing/feature_space.py:802
↓ 35 callers
Method
scope
Context manager to make the `Distribution` current.
keras/src/distribution/distribution_lib.py:400
↓ 35 callers
Method
symbolic_call
(self, *args, **kwargs)
keras/src/layers/layer.py:868
↓ 34 callers
Method
cumsum
(carry, xs)
keras/src/ops/core_test.py:1853
↓ 34 callers
Method
export
Export the model as an artifact for inference. Args: filepath: `str` or `pathlib.Path` object. The path to save the
keras/src/models/model.py:654
↓ 34 callers
Function
reduce_shape
(shape, axis=None, keepdims=False)
keras/src/ops/operation_utils.py:444
↓ 31 callers
Function
all
Test whether all array elements along a given axis evaluate to `True`. Args: x: Input tensor. axis: An integer or tuple of intege
keras/src/ops/numpy.py:318
↓ 31 callers
Method
assign
Assign a value to a variable. This should be used in optimizers instead of `variable.assign(value)` to support backend specific optim
keras/src/optimizers/base_optimizer.py:415
↓ 31 callers
Function
convert_to_tensor
(x, dtype=None, sparse=None, ragged=None)
keras/src/backend/openvino/core.py:840
↓ 31 callers
Function
floatx
Return the default float type, as a string. E.g. `'bfloat16'`, `'float16'`, `'float32'`, `'float64'`. Returns: String, the current d
keras/src/backend/config.py:27
↓ 31 callers
Function
max
Return the maximum of a tensor or maximum along an axis. Args: x: Input tensor. axis: Axis or axes along which to operate. By def
keras/src/ops/numpy.py:5140
↓ 31 callers
Function
min
Return the minimum of a tensor or minimum along an axis. Args: x: Input tensor. axis: Axis or axes along which to operate. By def
keras/src/ops/numpy.py:5379
↓ 31 callers
Method
quantize
(self, mode=None, type_check=True, config=None)
keras/src/layers/core/einsum_dense.py:1267
↓ 30 callers
Function
align_operand_types
(x1, x2, op_name, force_float=False)
keras/src/backend/openvino/core.py:80
↓ 30 callers
Function
any
Test whether any array element along a given axis evaluates to `True`. Args: x: Input tensor. axis: An integer or tuple of intege
keras/src/ops/numpy.py:467
↓ 30 callers
Method
save_weights
Saves all weights to a single file or sharded files. By default, the weights will be saved in a single `.weights.h5` file. If shardin
keras/src/models/model.py:320
↓ 28 callers
Method
get_weights
Return the values of `layer.weights` as a list of NumPy arrays.
keras/src/layers/layer.py:770
↓ 27 callers
Method
_get_seed_generator
(self, backend=None)
keras/src/layers/preprocessing/data_layer.py:137
↓ 27 callers
Method
extend
(self, values)
keras/src/utils/tracking.py:156
↓ 26 callers
Method
_get_variable_index
(self, variable)
keras/src/optimizers/base_optimizer.py:238
↓ 26 callers
Function
max
DEPRECATED.
keras/src/legacy/backend.py:996
↓ 25 callers
Method
build
(self, input_shape=None)
keras/src/models/sequential.py:164
↓ 25 callers
Method
save
Save the edited weights file. Args: filepath: Path to save the file to. Must be a `.weights.h5` file.
keras/src/saving/file_editor.py:416
↓ 24 callers
Method
build
(self, input_shape=None)
keras/src/layers/core/embedding.py:146
↓ 24 callers
Method
close
(self)
keras/src/saving/saving_lib.py:1424
next →
1–100 of 14,520, ranked by callers