Question stringlengths 55 280 | Response stringlengths 1 301 ⌀ |
|---|---|
Which optimizer in Keras 3 is specifically associated with the term "Loss Scale"? | Loss Scale Optimizer |
What local variable is used in the Keras `TruePositives` class to track the number of true positives? | true_positives |
In Keras 3, which model has the highest Top-1 accuracy among the Keras Applications? | InceptionResNetV2 |
What specific class in Keras 3 is responsible for terminating training when a NaN loss is encountered? | `TerminateOnNaN` |
What environment variable can configure the number of processes for a distributed computation cluster in Keras? | KERAS_DISTRIBUTION_NUM_PROCESSES |
In the context of Keras 3 API documentation, what is the default behavior for the `auto_shard_dataset` function? | True |
In the context of Keras version 3, what does setting the `from_sorted_ids` parameter to `True` in the `SparseTopKCategoricalAccuracy` metric optimize for? | Efficiency with large category sets. |
In keras, what argument does the `logspace` function lack support for when using the Torch backend? | axis |
What argument must be configured to apply a penalty to the output of a custom layer in Keras? | `activity_regularizer` |
What is the default threshold value used to calculate recall when neither thresholds nor top_k are set in the keras.metrics.Recall class based on the provided document? | 0.5 |
In the keras.ops API, what function would you use to clamp tensor values between -1 and 1? | keras.ops.hard_tanh |
What class in the Keras 3 RNG API is responsible for generating a seed? | SeedGenerator |
What two shapes can the tensor representing the list of decoded sequences have, based on the specified decoding strategy? | (1, batch_size, max_length); (top_paths, batch_size, max_length) |
What effect does calling `clear_session()` have on the layer name generation counter in Keras? | Resets the layer name generation counter. |
What will happen if you attempt to add a new attribute to a frozen Config object in Keras 3? | It will raise an error. |
In Keras, what function can be used to perform element-wise reciprocal square root on a tensor, and what is the expected data type of the output tensor? | `keras.ops.rsqrt`, same dtype as input tensor |
What is the purpose of the `roll` function in Keras operations? | Roll tensor elements along a given axis. |
What is the range of angle values returned by the `keras.ops.arctan2` function? | \[-pi, pi\] |
Which type of averaging in the Keras 3 `FBetaScore` class accounts for label imbalance when computing metrics for each label? | "weighted" |
What type of layers in the Keras Layers API are used to combine inputs in different ways, such as through addition, concatenation, or averaging? | Merging layers |
What specific dataset is suggested as an alternative to the MNIST digits classification dataset according to the Keras 3 API? | Fashion MNIST dataset |
Which function in Keras 3 can be used to compute the absolute value of each element in an input tensor? | keras.ops.absolute |
What environment variable must be set to ensure that `tf.keras` uses Keras 2 after upgrading to TensorFlow 2.16 or higher? | TF_USE_LEGACY_KERAS=1 |
What is the effect of setting the alpha parameter to 1 in the alpha-balanced focal loss for multi-class classification tasks? | It won't handle class imbalance properly as all classes will have the same weight. |
Which Keras Applications model includes variants labeled as B0 to B7? | EfficientNet B0 to B7 |
What is the default value of the fuzz factor set by the `set_epsilon` function in Keras 3? | 1e-07 |
What shape is the NumPy array for the test labels in the Fashion MNIST dataset? | (10000,) |
Which Keras 3 regression metric class computes the loss using the formula `sqrt(mean((y_pred - y_true) ** 2))`? | RootMeanSquaredError |
In the Keras 3 API, what happens to the learning rate in the Adafactor optimizer when the `relative_step` parameter is set to True and the `learning_rate` is a constant? | The learning rate will be adjusted based on current iterations. |
What type of values does the `y_true` parameter accept for the `keras.metrics.SquaredHinge` function, and how are binary labels handled? | -1 or 1 (binary 0 or 1 labels are converted to -1 or 1) |
Which axis must be set when using the `MinMaxNorm` weight constraint in a `Conv2D` layer with `data_format="channels_last"` in Keras 3? | [0, 1, 2] |
What is the default range for input pixels when using the EfficientNetV2 architecture with preprocessing included in the Keras model? | [0, 255] |
What type of pooling layer is added to the InceptionV3 model before the fully-connected layer when fine-tuning it for a new classification task in Keras? | GlobalAveragePooling2D |
What class in the Keras 3 API is designed to map string keys to `TensorLayout` instances, treating the string as a regex for retrieval? | `LayoutMap` |
What impact does calling `keras.utils.clear_session(free_memory=True)` have on layer name generation in a loop creating models with Keras? | It resets the layer name generation counter. |
What is the formula for calculating the Mean Absolute Error in the Keras library? | loss = mean(abs(y_true - y_pred)) |
What is the threshold used in the `BinaryIoU` class to convert prediction logits for computing the Intersection-Over-Union metric? | 0.5 |
In Keras version 3, what is the default image data format used by the `array_to_img` function if not specified? | "channels_last" |
What specific preprocessing function should be applied to inputs before using them with the InceptionResNetV2 model in Keras, and what is its effect on input pixels? | `keras.applications.inception_resnet_v2.preprocess_input`; scales input pixels between -1 and 1. |
What file extension should `filepath` end with when using `ModelCheckpoint` in Keras 3 and `save_weights_only=True`? | .weights.h5 |
In the Keras `tensordot` function, what must match when using an integer `axes` value for the tensor dot product? | The sizes of the corresponding axes must match. |
What optional argument in the Keras `BinaryCrossentropy` class allows relaxation of label confidence by adjusting label values, especially useful when label values are initially set to a probability distribution? | label_smoothing |
Which company uses Keras for powering self-driving vehicles? | Waymo |
What does the `remat` function in Keras 3 API do to optimize memory usage during model training? | Applies rematerialization to a function or layer for memory optimization by recomputing intermediate results during backpropagation, reducing peak memory usage. |
What feature does the `Functional API` in Keras allow for when creating models with intermediate tensors in version 3? | Creating sub-models from intermediate tensors. |
What interpolation methods are available for resizing images using the `resize` function in Keras version 3.3, and what is the default method? | Interpolation methods: "nearest", "bilinear", "bicubic". Default method: "bilinear". |
What type of tensor is required for the window argument when specifying a custom window for the keras.ops.istft function in Keras 3? | Tensor |
What environment variable must be set to keep using Keras 2 with TensorFlow 2.16 or later? | TF_USE_LEGACY_KERAS=1 |
What happens if the `index` argument in the `keras.ops.switch` function exceeds the number of available branches? | The index is clamped to the nearest valid position within the bounds. |
Which keras function provides the element-wise arc tangent of two input tensors with consideration for the quadrant? | keras.ops.arctan2 |
Which specific class in Keras 3 can be used to wrap a stateless metric function with a mean calculation? | MeanMetricWrapper |
What is the default reduction type for the `SparseCategoricalCrossentropy` class in keras? | sum_over_batch_size |
What happens if you try to append two tensors with incompatible dimensions using the `append` function in Keras? | TypeError: Cannot concatenate arrays with different numbers of dimensions. |
What type of loss function in Keras is used specifically for "maximum-margin" classification? | Hinge losses |
In Keras 3, what is the purpose of the `trainable` attribute in the `Layer` class? | Boolean, whether the layer's variables should be trainable. |
What is the threshold value above which the keras.activations.hard_shrink function returns the input tensor as per the default parameter settings? | 0.5 |
Which optimizer listed in the document adjusts the learning rate based on plateau detection during training? | ReduceLROnPlateau |
Which component in Keras 3 is specifically designed to handle "maximum-margin" classification? | Hinge losses |
Which regularization layer from Keras is specifically designed to prevent overfitting by randomly dropping neurons during training in three-dimensional space? | SpatialDropout3D layer |
What is a necessary step when saving and loading models with custom regularizers to HDF5 format in Keras? | Register the custom regularizer. |
In Keras V3, which technique is used for efficient parameter fine-tuning of GPT-2? | LoRA |
Which optimizer in Keras 3 is specifically designed to handle maximum-margin classification problems? | Hinge losses |
What argument can be used to make the behavior of the `RandomNormal` initializer deterministic in Keras 3? | seed |
What should be the input shape for the `DenseNet169` model when `include_top` is set to `True` and the data format is `'channels_last'`? | (224, 224, 3) |
For the `audio_dataset_from_directory` function in Keras 3, what determines the order of labels when using `labels='inferred'` and `label_mode='categorical'`? | Alphanumeric order of subdirectory names. |
What is the function of the `aggregation` parameter in the `add_weight` method of a Keras Layer and what is its default value? | The `aggregation` parameter in the `add_weight` method specifies the type of multi-replica aggregation for the variable and its default value is `"none"`. |
What type of arguments do the `on_epoch_begin` and `on_epoch_end` functions expect when using the `LambdaCallback` in Keras 2? | `epoch`, `logs` |
Which Keras function would you use to determine if a real or complex tensor has only finite numbers, specifically requiring that complex numbers have both parts finite? | is_finite |
What reserved keyword argument in the `call()` method of a Keras layer is used to indicate whether the call is in training mode or inference mode? | training |
What method in Keras (version 2.9) is used to create weights that depend on the input shape and is automatically called if the layer hasn’t been built yet? | build |
What does the `k` parameter in the `keras.ops.eye` function control? | Index of the diagonal. |
What is the default input image size for the Xception model in Keras version 3? | 299x299 |
Which function is used to calculate the inverse hyperbolic tangent of each element in an array? | arctanh |
Which function is used to count the number of non-zero elements in an array? | count_nonzero |
What input preprocessing step must be done for images before they are passed to a MobileNet model in Keras 3? | keras.applications.mobilenet.preprocess_input |
What is the optional pooling mode applied when the DenseNet model's `include_top` argument is set to `False`, which results in a 2D tensor output in Keras 3? | avg |
What does a negative R2Score indicate about a model's predictive accuracy in keras version 3? | The model is worse than random. |
What does the "synchronized" argument do in the `moments` function, and when is it applicable? | Synchronizes global batch statistics across all devices in distributed training when using the TensorFlow backend. |
What is the shape of the output when applying `keras.ops.image.extract_patches` to a single RGB image of shape (20, 20, 3) using a patch size of (3, 3) and a stride of (1, 1)? | (18, 18, 27) |
In Keras version 3, what class is used for generating seeds in random operations? | SeedGenerator |
In Keras 3, what API can be used for setting a mixed precision policy? | Mixed precision policy API |
What arguments are required for the `fft2` function in Keras 3, and what do they represent? | x: Tuple of the real and imaginary parts of the input tensor, both of floating type. |
What is the Tversky loss equivalent to when both alpha and beta coefficients are set to 0.5? | Dice Loss |
Which dtype is used by default for the computations of the `LogCosh` loss in Keras? | float32 |
In the Keras function `binary_crossentropy`, what is the default shape of the returned loss value? | \[batch\_size, d0, \ldots, dN-1\] |
What is the shape of the mean absolute percentage error values returned when using the relevant Keras function with inputs of shape `[batch_size, d0, .. dN]`? | [batch_size, d0, .. dN-1] |
What type of regularization does the FTRL optimizer in Keras support, and what is its primary application setting? | L1 and L2 regularization; suitable for large and sparse feature spaces. |
In Keras 2, when using the `ModelCheckpoint` callback, how does the `mode` parameter determine whether to minimize or maximize the monitored metric based on commonly used metric names? | 'auto': 'max' for 'acc' or 'fmeasure'; 'min' for others. |
What does setting the `keepdims` argument to `True` affect when using the `argmax` or `argmin` functions in Keras? | The reduced axes are left in the result as dimensions with size one. |
What is the characteristic shape of the numpy arrays returned by the `load_data` function for the California Housing price regression dataset in Keras? | `x_train`, `x_test`: (num_samples, 8)
`y_train`, `y_test`: (num_samples,) |
What is the primary condition under which SELU activation function preserves the mean and variance of inputs between layers? | Correct weight initialization (using `LecunNormal`) and a large enough number of input units. |
What initializer should be used with the SELU activation function to optimize its performance in Keras? | LecunNormal |
Which Keras 2 API callback function is specifically designed to terminate training upon encountering a NaN loss? | TerminateOnNaN |
Which Keras API function is used for loading image data from a directory, and under which version is it available? | image_dataset_from_directory function, available under Keras 2. |
Which Keras API in version 3 provides classes for managing random number generation operations? | RNG API |
Under what condition does the `split` function in Keras not necessarily result in equal divisions of a tensor? | When using the Torch backend. |
In the context of FeatureSpace, which preprocessing layer is applied to float values when using "float_normalized"? | keras.layers.Normalization |
What argument does the `squeeze` function in Keras use to select specific dimensions to remove from a tensor? | axis |
What is the default output mode for the discrete representation of float values when discretized into bins using FeatureSpace in Keras? | one_hot |
Which keras function computes the bit-wise OR of two arrays using the operator `|` on their binary representations? | keras.ops.bitwise_or |
End of preview. Expand in Data Studio
Samples in this benchmark were generated by RELAI using the following data source(s):
Data Source Name: keras
Documentation Data Source Link: https://keras.io/
Data Source License: https://github.com/keras-team/keras/blob/master/LICENSE
Data Source Authors: Observable AI Benchmarks by Data Agents © 2025 RELAI.AI. Licensed under CC BY 4.0. Source: https://relai.ai
- Downloads last month
- 16