Package: keras 2.15.0

keras:R Interface to 'Keras'

Interface to 'Keras' <https://keras.io>, a high-level neural networks 'API'. 'Keras' was developed with a focus on enabling fast experimentation, supports both convolution based networks and recurrent networks (as well as combinations of the two), and runs seamlessly on both 'CPU' and 'GPU' devices.

Authors:Tomasz Kalinowski [ctb, cph, cre], Daniel Falbel [ctb, cph], JJ Allaire [aut, cph], François Chollet [aut, cph], RStudio [ctb, cph, fnd], Google [ctb, cph, fnd], Yuan Tang [ctb, cph], Wouter Van Der Bijl [ctb, cph], Martin Studer [ctb, cph], Sigrid Keydana [ctb]

keras_2.15.0.tar.gz
keras_2.15.0.zip(r-4.5)keras_2.15.0.zip(r-4.4)keras_2.15.0.zip(r-4.3)
keras_2.15.0.tgz(r-4.4-any)keras_2.15.0.tgz(r-4.3-any)
keras_2.15.0.tar.gz(r-4.5-noble)keras_2.15.0.tar.gz(r-4.4-noble)
keras_2.15.0.tgz(r-4.4-emscripten)keras_2.15.0.tgz(r-4.3-emscripten)
keras.pdf |keras.html
keras/json (API)
NEWS

# Installkeras in R:
install.packages('keras',repos = c('https://t-kalinowski.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/rstudio/keras/issues

On CRAN:

560 exports 5.04 score 32 dependencies 57 dependents 141 mentions 24.6k downloads

Last updated 3 months agofrom:76c37ab101

Exports:%<-%%<-active%%<>%%>%%py_class%activation_eluactivation_exponentialactivation_geluactivation_hard_sigmoidactivation_linearactivation_reluactivation_seluactivation_sigmoidactivation_softmaxactivation_softplusactivation_softsignactivation_swishactivation_tanhadaptapplication_densenetapplication_densenet121application_densenet169application_densenet201application_efficientnet_b0application_efficientnet_b1application_efficientnet_b2application_efficientnet_b3application_efficientnet_b4application_efficientnet_b5application_efficientnet_b6application_efficientnet_b7application_inception_resnet_v2application_inception_v3application_mobilenetapplication_mobilenet_v2application_mobilenet_v3_largeapplication_mobilenet_v3_smallapplication_nasnetapplication_nasnetlargeapplication_nasnetmobileapplication_resnet101application_resnet101_v2application_resnet152application_resnet152_v2application_resnet50application_resnet50_v2application_vgg16application_vgg19application_xceptionarray_reshapeas_tensorbackendbidirectionalcallback_backup_and_restorecallback_csv_loggercallback_early_stoppingcallback_lambdacallback_learning_rate_schedulercallback_model_checkpointcallback_progbar_loggercallback_reduce_lr_on_plateaucallback_remote_monitorcallback_tensorboardcallback_terminate_on_naanclone_modelcompileconstraint_maxnormconstraint_minmaxnormconstraint_nonnegconstraint_unitnormcount_paramscreate_layercreate_layer_wrappercreate_wrappercustom_metricdataset_boston_housingdataset_cifar10dataset_cifar100dataset_fashion_mnistdataset_imdbdataset_imdb_word_indexdataset_mnistdataset_reutersdataset_reuters_word_indexdensenet_preprocess_inputevaluateevaluate_generatorexport_savedmodelfitfit_generatorfit_image_data_generatorfit_text_tokenizerflag_booleanflag_integerflag_numericflag_stringflagsflow_images_from_dataflow_images_from_dataframeflow_images_from_directoryfreeze_weightsfrom_configgenerator_nextget_configget_fileget_input_atget_input_mask_atget_input_shape_atget_layerget_output_atget_output_mask_atget_output_shape_atget_vocabularyget_weightshdf5_matriximage_array_resizeimage_array_saveimage_data_generatorimage_dataset_from_directoryimage_loadimage_to_arrayimagenet_decode_predictionsimagenet_preprocess_inputimplementationinception_resnet_v2_preprocess_inputinception_v3_preprocess_inputinitializer_constantinitializer_glorot_normalinitializer_glorot_uniforminitializer_he_normalinitializer_he_uniforminitializer_identityinitializer_lecun_normalinitializer_lecun_uniforminitializer_onesinitializer_orthogonalinitializer_random_normalinitializer_random_uniforminitializer_truncated_normalinitializer_variance_scalinginitializer_zerosinstall_kerasis_keras_availablek_absk_allk_anyk_arangek_argmaxk_argmink_backendk_batch_dotk_batch_flattenk_batch_get_valuek_batch_normalizationk_batch_set_valuek_bias_addk_binary_crossentropyk_castk_cast_to_floatxk_categorical_crossentropyk_clear_sessionk_clipk_concatenatek_constantk_conv1dk_conv2dk_conv2d_transposek_conv3dk_conv3d_transposek_cosk_count_paramsk_ctc_batch_costk_ctc_decodek_ctc_label_dense_to_sparsek_cumprodk_cumsumk_depthwise_conv2dk_dotk_dropoutk_dtypek_eluk_epsilonk_equalk_evalk_expk_expand_dimsk_eyek_flattenk_floatxk_foldlk_foldrk_functionk_gatherk_get_sessionk_get_uidk_get_valuek_get_variable_shapek_gradientsk_greaterk_greater_equalk_hard_sigmoidk_identityk_image_data_formatk_in_test_phasek_in_top_kk_in_train_phasek_int_shapek_is_keras_tensork_is_placeholderk_is_sparsek_is_tensork_l2_normalizek_learning_phasek_lessk_less_equalk_local_conv1dk_local_conv2dk_logk_logsumexpk_manual_variable_initializationk_map_fnk_maxk_maximumk_meank_mink_minimumk_moving_average_updatek_ndimk_normalize_batch_in_trainingk_not_equalk_one_hotk_onesk_ones_likek_permute_dimensionsk_placeholderk_pool2dk_pool3dk_powk_print_tensork_prodk_random_bernoullik_random_binomialk_random_normalk_random_normal_variablek_random_uniformk_random_uniform_variablek_reluk_repeatk_repeat_elementsk_reset_uidsk_reshapek_resize_imagesk_resize_volumesk_reversek_rnnk_roundk_separable_conv2dk_set_epsilonk_set_floatxk_set_image_data_formatk_set_learning_phasek_set_sessionk_set_valuek_shapek_sigmoidk_signk_sink_softmaxk_softplusk_softsignk_sparse_categorical_crossentropyk_spatial_2d_paddingk_spatial_3d_paddingk_sqrtk_squarek_squeezek_stackk_stdk_stop_gradientk_sumk_switchk_tanhk_temporal_paddingk_tilek_to_densek_transposek_truncated_normalk_unstackk_updatek_update_addk_update_subk_vark_variablek_zerosk_zeros_likekeraskeras_arraykeras_modelkeras_model_customkeras_model_sequentialKerasCallbackKerasConstraintKerasLayerKerasWrapperLayerlayer_activationlayer_activation_elulayer_activation_leaky_relulayer_activation_parametric_relulayer_activation_relulayer_activation_selulayer_activation_softmaxlayer_activation_thresholded_relulayer_activity_regularizationlayer_addlayer_additive_attentionlayer_alpha_dropoutlayer_attentionlayer_averagelayer_average_pooling_1dlayer_average_pooling_2dlayer_average_pooling_3dlayer_batch_normalizationlayer_category_encodinglayer_center_croplayer_concatenatelayer_conv_1dlayer_conv_1d_transposelayer_conv_2dlayer_conv_2d_transposelayer_conv_3dlayer_conv_3d_transposelayer_conv_lstm_1dlayer_conv_lstm_2dlayer_conv_lstm_3dlayer_cropping_1dlayer_cropping_2dlayer_cropping_3dlayer_cudnn_grulayer_cudnn_lstmlayer_denselayer_dense_featureslayer_depthwise_conv_1dlayer_depthwise_conv_2dlayer_discretizationlayer_dotlayer_dropoutlayer_embeddinglayer_flattenlayer_gaussian_dropoutlayer_gaussian_noiselayer_global_average_pooling_1dlayer_global_average_pooling_2dlayer_global_average_pooling_3dlayer_global_max_pooling_1dlayer_global_max_pooling_2dlayer_global_max_pooling_3dlayer_grulayer_gru_celllayer_hashinglayer_inputlayer_integer_lookuplayer_lambdalayer_layer_normalizationlayer_locally_connected_1dlayer_locally_connected_2dlayer_lstmlayer_lstm_celllayer_maskinglayer_max_pooling_1dlayer_max_pooling_2dlayer_max_pooling_3dlayer_maximumlayer_minimumlayer_multi_head_attentionlayer_multiplylayer_normalizationlayer_permutelayer_random_brightnesslayer_random_contrastlayer_random_croplayer_random_fliplayer_random_heightlayer_random_rotationlayer_random_translationlayer_random_widthlayer_random_zoomlayer_repeat_vectorlayer_rescalinglayer_reshapelayer_resizinglayer_rnnlayer_separable_conv_1dlayer_separable_conv_2dlayer_simple_rnnlayer_simple_rnn_celllayer_spatial_dropout_1dlayer_spatial_dropout_2dlayer_spatial_dropout_3dlayer_stacked_rnn_cellslayer_string_lookuplayer_subtractlayer_text_vectorizationlayer_unit_normalizationlayer_upsampling_1dlayer_upsampling_2dlayer_upsampling_3dlayer_zero_padding_1dlayer_zero_padding_2dlayer_zero_padding_3dlearning_rate_schedule_cosine_decaylearning_rate_schedule_cosine_decay_restartslearning_rate_schedule_exponential_decaylearning_rate_schedule_inverse_time_decaylearning_rate_schedule_piecewise_constant_decaylearning_rate_schedule_polynomial_decayload_model_hdf5load_model_tfload_model_weights_hdf5load_model_weights_tfload_text_tokenizerloss_binary_crossentropyloss_categorical_crossentropyloss_categorical_hingeloss_cosine_proximityloss_cosine_similarityloss_hingeloss_huberloss_kl_divergenceloss_kullback_leibler_divergenceloss_logcoshloss_mean_absolute_errorloss_mean_absolute_percentage_errorloss_mean_squared_errorloss_mean_squared_logarithmic_errorloss_poissonloss_sparse_categorical_crossentropyloss_squared_hingemake_sampling_tablemark_activemetric_accuracymetric_aucmetric_binary_accuracymetric_binary_crossentropymetric_categorical_accuracymetric_categorical_crossentropymetric_categorical_hingemetric_cosine_proximitymetric_cosine_similaritymetric_false_negativesmetric_false_positivesmetric_hingemetric_kullback_leibler_divergencemetric_logcosh_errormetric_meanmetric_mean_absolute_errormetric_mean_absolute_percentage_errormetric_mean_ioumetric_mean_relative_errormetric_mean_squared_errormetric_mean_squared_logarithmic_errormetric_mean_tensormetric_mean_wrappermetric_poissonmetric_precisionmetric_precision_at_recallmetric_recallmetric_recall_at_precisionmetric_root_mean_squared_errormetric_sensitivity_at_specificitymetric_sparse_categorical_accuracymetric_sparse_categorical_crossentropymetric_sparse_top_k_categorical_accuracymetric_specificity_at_sensitivitymetric_squared_hingemetric_summetric_top_k_categorical_accuracymetric_true_negativesmetric_true_positivesmobilenet_decode_predictionsmobilenet_load_model_hdf5mobilenet_preprocess_inputmobilenet_v2_decode_predictionsmobilenet_v2_load_model_hdf5mobilenet_v2_preprocess_inputmodel_from_jsonmodel_from_saved_modelmodel_from_yamlmodel_to_jsonmodel_to_saved_modelmodel_to_yamlmulti_gpu_modelnasnet_preprocess_inputnew_callback_classnew_layer_classnew_learning_rate_schedule_classnew_loss_classnew_metric_classnew_model_classnormalizeoptimizer_adadeltaoptimizer_adagradoptimizer_adamoptimizer_adamaxoptimizer_ftrloptimizer_nadamoptimizer_rmspropoptimizer_sgdpad_sequencespop_layerpredict_classespredict_generatorpredict_on_batchpredict_probaregularizer_l1regularizer_l1_l2regularizer_l2regularizer_orthogonalreset_statesresnet_preprocess_inputresnet_v2_preprocess_inputrun_dirsave_model_hdf5save_model_tfsave_model_weights_hdf5save_model_weights_tfsave_text_tokenizersequences_to_matrixserialize_modelset_vocabularyset_weightsshapeskipgramstensorboardtest_on_batchtext_dataset_from_directorytext_hashing_tricktext_one_hottext_to_word_sequencetext_tokenizertexts_to_matrixtexts_to_sequencestexts_to_sequences_generatortime_distributedtimeseries_dataset_from_arraytimeseries_generatorto_categoricaltrain_on_batchtupleunfreeze_weightsunserialize_modeluse_backenduse_condaenvuse_implementationuse_pythonuse_session_with_seeduse_virtualenvwith_custom_object_scopexception_preprocess_inputzip_lists

Dependencies:backportsbase64enccliconfiggenericsglueherejsonlitelatticelifecyclemagrittrMatrixpngprocessxpsR6rappdirsRcppRcppTOMLreticulaterlangrprojrootrstudioapitensorflowtfautographtfrunstidyselectvctrswhiskerwithryamlzeallot

Frequently Asked Questions

Rendered fromfaq.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2022-12-20
Started: 2017-07-30

Getting Started with Keras

Rendered fromindex.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2022-12-20
Started: 2020-05-19

Guide to Keras Basics

Rendered fromguide_keras.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2022-12-20
Started: 2018-08-24

Guide to the Functional API

Rendered fromfunctional_api.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2021-03-29
Started: 2017-07-30

Guide to the Sequential Model

Rendered fromsequential_model.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2020-05-19
Started: 2017-07-30

Saving and serializing models

Rendered fromsaving_serializing.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2021-03-29
Started: 2019-10-08

Training Callbacks

Rendered fromtraining_callbacks.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2020-05-19
Started: 2017-07-30

Training Visualization

Rendered fromtraining_visualization.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2022-12-20
Started: 2017-08-30

Using Pre-Trained Models

Rendered fromapplications.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2022-12-20
Started: 2017-07-30

Writing Custom Keras Layers

Rendered fromcustom_layers.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2022-12-20
Started: 2017-07-30

Writing Custom Keras Models

Rendered fromcustom_models.Rmdusingknitr::rmarkdownon Jun 20 2024.

Last update: 2020-05-19
Started: 2018-08-24

Readme and manuals

Help Manual

Help pageTopics
R interface to Keraskeras-package
Make an Active Binding%<-active%
Make a python class constructor%py_class% py_class
Activation functionsactivation_elu activation_exponential activation_gelu activation_hard_sigmoid activation_linear activation_relu activation_selu activation_sigmoid activation_softmax activation_softplus activation_softsign activation_swish activation_tanh
Fits the state of the preprocessing layer to the data being passedadapt
Instantiates the DenseNet architecture.application_densenet application_densenet121 application_densenet169 application_densenet201 densenet_preprocess_input
Instantiates the EfficientNetB0 architectureapplication_efficientnet application_efficientnet_b0 application_efficientnet_b1 application_efficientnet_b2 application_efficientnet_b3 application_efficientnet_b4 application_efficientnet_b5 application_efficientnet_b6 application_efficientnet_b7
Inception-ResNet v2 model, with weights trained on ImageNetapplication_inception_resnet_v2 inception_resnet_v2_preprocess_input
Inception V3 model, with weights pre-trained on ImageNet.application_inception_v3 inception_v3_preprocess_input
MobileNet model architecture.application_mobilenet mobilenet_decode_predictions mobilenet_load_model_hdf5 mobilenet_preprocess_input
MobileNetV2 model architectureapplication_mobilenet_v2 mobilenet_v2_decode_predictions mobilenet_v2_load_model_hdf5 mobilenet_v2_preprocess_input
Instantiates the MobileNetV3Large architectureapplication_mobilenet_v3 application_mobilenet_v3_large application_mobilenet_v3_small
Instantiates a NASNet model.application_nasnet application_nasnetlarge application_nasnetmobile nasnet_preprocess_input
Instantiates the ResNet architectureapplication_resnet application_resnet101 application_resnet101_v2 application_resnet152 application_resnet152_v2 application_resnet50 application_resnet50_v2 resnet_preprocess_input resnet_v2_preprocess_input
VGG16 and VGG19 models for Keras.application_vgg application_vgg16 application_vgg19
Instantiates the Xception architectureapplication_xception xception_preprocess_input
Keras backend tensor enginebackend
Bidirectional wrapper for RNNsbidirectional
Callback to back up and restore the training statecallback_backup_and_restore
Callback that streams epoch results to a csv filecallback_csv_logger
Stop training when a monitored quantity has stopped improving.callback_early_stopping
Create a custom callbackcallback_lambda
Learning rate scheduler.callback_learning_rate_scheduler
Save the model after every epoch.callback_model_checkpoint
Callback that prints metrics to stdout.callback_progbar_logger
Reduce learning rate when a metric has stopped improving.callback_reduce_lr_on_plateau
Callback used to stream events to a server.callback_remote_monitor
TensorBoard basic visualizationscallback_tensorboard
Callback that terminates training when a NaN loss is encountered.callback_terminate_on_naan
Clone a model instance.clone_model
Configure a Keras model for trainingcompile.keras.engine.training.Model
Weight constraintsconstraints constraint_maxnorm constraint_minmaxnorm constraint_nonneg constraint_unitnorm
Count the total number of scalars composing the weights.count_params
Create a Keras Layercreate_layer
Create a Keras Layer wrappercreate_layer_wrapper
Custom metric functioncustom_metric
Boston housing price regression datasetdataset_boston_housing
CIFAR10 small image classificationdataset_cifar10
CIFAR100 small image classificationdataset_cifar100
Fashion-MNIST database of fashion articlesdataset_fashion_mnist
IMDB Movie reviews sentiment classificationdataset_imdb dataset_imdb_word_index
MNIST database of handwritten digitsdataset_mnist
Reuters newswire topics classificationdataset_reuters dataset_reuters_word_index
Evaluate a Keras modelevaluate.keras.engine.training.Model
Export a Saved Modelexport_savedmodel.keras.engine.training.Model
Fit image data generator internal statistics to some sample data.fit_image_data_generator
Update tokenizer internal vocabulary based on a list of texts or list of sequences.fit_text_tokenizer
Train a Keras modelfit.keras.engine.training.Model
Generates batches of augmented/normalized data from image data and labelsflow_images_from_data
Takes the dataframe and the path to a directory and generates batches of augmented/normalized data.flow_images_from_dataframe
Generates batches of data from images in a directory (with optional augmented/normalized data)flow_images_from_directory
Freeze and unfreeze weightsfreeze_weights unfreeze_weights
Retrieve the next item from a generatorgenerator_next
Layer/Model configurationfrom_config get_config
Downloads a file from a URL if it not already in the cache.get_file
Retrieve tensors for layers with multiple nodesget_input_at get_input_mask_at get_input_shape_at get_output_at get_output_mask_at get_output_shape_at
Retrieves a layer based on either its name (unique) or index.get_layer
Layer/Model weights as R arraysget_weights set_weights
Representation of HDF5 dataset to be used instead of an R arrayhdf5_matrix
Deprecated Generate batches of image data with real-time data augmentation. The data will be looped over (in batches).image_data_generator
Create a dataset from a directoryimage_dataset_from_directory
Loads an image into PIL format.image_load
3D array representation of imagesimage_array_resize image_array_save image_to_array
Decodes the prediction of an ImageNet model.imagenet_decode_predictions
Preprocesses a tensor or array encoding a batch of images.imagenet_preprocess_input
Keras implementationimplementation
Initializer that generates tensors initialized to a constant value.initializer_constant
Glorot normal initializer, also called Xavier normal initializer.initializer_glorot_normal
Glorot uniform initializer, also called Xavier uniform initializer.initializer_glorot_uniform
He normal initializer.initializer_he_normal
He uniform variance scaling initializer.initializer_he_uniform
Initializer that generates the identity matrix.initializer_identity
LeCun normal initializer.initializer_lecun_normal
LeCun uniform initializer.initializer_lecun_uniform
Initializer that generates tensors initialized to 1.initializer_ones
Initializer that generates a random orthogonal matrix.initializer_orthogonal
Initializer that generates tensors with a normal distribution.initializer_random_normal
Initializer that generates tensors with a uniform distribution.initializer_random_uniform
Initializer that generates a truncated normal distribution.initializer_truncated_normal
Initializer capable of adapting its scale to the shape of weights.initializer_variance_scaling
Initializer that generates tensors initialized to 0.initializer_zeros
Install TensorFlow and Keras, including all Python dependenciesinstall_keras
Check if Keras is Availableis_keras_available
Element-wise absolute value.k_abs
Bitwise reduction (logical AND).k_all
Bitwise reduction (logical OR).k_any
Creates a 1D tensor containing a sequence of integers.k_arange
Returns the index of the maximum value along an axis.k_argmax
Returns the index of the minimum value along an axis.k_argmin
Active Keras backendk_backend
Batchwise dot product.k_batch_dot
Turn a nD tensor into a 2D tensor with same 1st dimension.k_batch_flatten
Returns the value of more than one tensor variable.k_batch_get_value
Applies batch normalization on x given mean, var, beta and gamma.k_batch_normalization
Sets the values of many tensor variables at once.k_batch_set_value
Adds a bias vector to a tensor.k_bias_add
Binary crossentropy between an output tensor and a target tensor.k_binary_crossentropy
Casts a tensor to a different dtype and returns it.k_cast
Cast an array to the default Keras float type.k_cast_to_floatx
Categorical crossentropy between an output tensor and a target tensor.k_categorical_crossentropy
Destroys the current TF graph and creates a new one.k_clear_session
Element-wise value clipping.k_clip
Concatenates a list of tensors alongside the specified axis.k_concatenate
Creates a constant tensor.k_constant
1D convolution.k_conv1d
2D convolution.k_conv2d
2D deconvolution (i.e. transposed convolution).k_conv2d_transpose
3D convolution.k_conv3d
3D deconvolution (i.e. transposed convolution).k_conv3d_transpose
Computes cos of x element-wise.k_cos
Returns the static number of elements in a Keras variable or tensor.k_count_params
Runs CTC loss algorithm on each batch element.k_ctc_batch_cost
Decodes the output of a softmax.k_ctc_decode
Converts CTC labels from dense to sparse.k_ctc_label_dense_to_sparse
Cumulative product of the values in a tensor, alongside the specified axis.k_cumprod
Cumulative sum of the values in a tensor, alongside the specified axis.k_cumsum
Depthwise 2D convolution with separable filters.k_depthwise_conv2d
Multiplies 2 tensors (and/or variables) and returns a _tensor_.k_dot
Sets entries in 'x' to zero at random, while scaling the entire tensor.k_dropout
Returns the dtype of a Keras tensor or variable, as a string.k_dtype
Exponential linear unit.k_elu
Fuzz factor used in numeric expressions.k_epsilon k_set_epsilon
Element-wise equality between two tensors.k_equal
Evaluates the value of a variable.k_eval
Element-wise exponential.k_exp
Adds a 1-sized dimension at index 'axis'.k_expand_dims
Instantiate an identity matrix and returns it.k_eye
Flatten a tensor.k_flatten
Default float typek_floatx k_set_floatx
Reduce elems using fn to combine them from left to right.k_foldl
Reduce elems using fn to combine them from right to left.k_foldr
Instantiates a Keras functionk_function
Retrieves the elements of indices 'indices' in the tensor 'reference'.k_gather
TF session to be used by the backend.k_get_session k_set_session
Get the uid for the default graph.k_get_uid
Returns the value of a variable.k_get_value
Returns the shape of a variable.k_get_variable_shape
Returns the gradients of 'variables' w.r.t. 'loss'.k_gradients
Element-wise truth value of (x > y).k_greater
Element-wise truth value of (x >= y).k_greater_equal
Segment-wise linear approximation of sigmoid.k_hard_sigmoid
Returns a tensor with the same content as the input tensor.k_identity
Default image data format convention ('channels_first' or 'channels_last').k_image_data_format k_set_image_data_format
Selects 'x' in test phase, and 'alt' otherwise.k_in_test_phase
Returns whether the 'targets' are in the top 'k' 'predictions'.k_in_top_k
Selects 'x' in train phase, and 'alt' otherwise.k_in_train_phase
Returns the shape of tensor or variable as a list of int or NULL entries.k_int_shape
Returns whether 'x' is a Keras tensor.k_is_keras_tensor
Returns whether 'x' is a placeholder.k_is_placeholder
Returns whether a tensor is a sparse tensor.k_is_sparse
Returns whether 'x' is a symbolic tensor.k_is_tensor
Normalizes a tensor wrt the L2 norm alongside the specified axis.k_l2_normalize
Returns the learning phase flag.k_learning_phase
Element-wise truth value of (x < y).k_less
Element-wise truth value of (x <= y).k_less_equal
Apply 1D conv with un-shared weights.k_local_conv1d
Apply 2D conv with un-shared weights.k_local_conv2d
Element-wise log.k_log
Sets the manual variable initialization flag.k_manual_variable_initialization
Map the function fn over the elements elems and return the outputs.k_map_fn
Maximum value in a tensor.k_max
Element-wise maximum of two tensors.k_maximum
Mean of a tensor, alongside the specified axis.k_mean
Minimum value in a tensor.k_min
Element-wise minimum of two tensors.k_minimum
Compute the moving average of a variable.k_moving_average_update
Returns the number of axes in a tensor, as an integer.k_ndim
Computes mean and std for batch then apply batch_normalization on batch.k_normalize_batch_in_training
Element-wise inequality between two tensors.k_not_equal
Computes the one-hot representation of an integer tensor.k_one_hot
Instantiates an all-ones tensor variable and returns it.k_ones
Instantiates an all-ones variable of the same shape as another tensor.k_ones_like
Permutes axes in a tensor.k_permute_dimensions
Instantiates a placeholder tensor and returns it.k_placeholder
2D Pooling.k_pool2d
3D Pooling.k_pool3d
Element-wise exponentiation.k_pow
Prints 'message' and the tensor value when evaluated.k_print_tensor
Multiplies the values in a tensor, alongside the specified axis.k_prod
Returns a tensor with random binomial distribution of values.k_random_bernoulli k_random_binomial
Returns a tensor with normal distribution of values.k_random_normal
Instantiates a variable with values drawn from a normal distribution.k_random_normal_variable
Returns a tensor with uniform distribution of values.k_random_uniform
Instantiates a variable with values drawn from a uniform distribution.k_random_uniform_variable
Rectified linear unit.k_relu
Repeats a 2D tensor.k_repeat
Repeats the elements of a tensor along an axis.k_repeat_elements
Reset graph identifiers.k_reset_uids
Reshapes a tensor to the specified shape.k_reshape
Resizes the images contained in a 4D tensor.k_resize_images
Resizes the volume contained in a 5D tensor.k_resize_volumes
Reverse a tensor along the specified axes.k_reverse
Iterates over the time dimension of a tensork_rnn
Element-wise rounding to the closest integer.k_round
2D convolution with separable filters.k_separable_conv2d
Sets the learning phase to a fixed value.k_set_learning_phase
Sets the value of a variable, from an R array.k_set_value
Returns the symbolic shape of a tensor or variable.k_shape
Element-wise sigmoid.k_sigmoid
Element-wise sign.k_sign
Computes sin of x element-wise.k_sin
Softmax of a tensor.k_softmax
Softplus of a tensor.k_softplus
Softsign of a tensor.k_softsign
Categorical crossentropy with integer targets.k_sparse_categorical_crossentropy
Pads the 2nd and 3rd dimensions of a 4D tensor.k_spatial_2d_padding
Pads 5D tensor with zeros along the depth, height, width dimensions.k_spatial_3d_padding
Element-wise square root.k_sqrt
Element-wise square.k_square
Removes a 1-dimension from the tensor at index 'axis'.k_squeeze
Stacks a list of rank 'R' tensors into a rank 'R+1' tensor.k_stack
Standard deviation of a tensor, alongside the specified axis.k_std
Returns 'variables' but with zero gradient w.r.t. every other variable.k_stop_gradient
Sum of the values in a tensor, alongside the specified axis.k_sum
Switches between two operations depending on a scalar value.k_switch
Element-wise tanh.k_tanh
Pads the middle dimension of a 3D tensor.k_temporal_padding
Creates a tensor by tiling 'x' by 'n'.k_tile
Converts a sparse tensor into a dense tensor and returns it.k_to_dense
Transposes a tensor and returns it.k_transpose
Returns a tensor with truncated random normal distribution of values.k_truncated_normal
Unstack rank 'R' tensor into a list of rank 'R-1' tensors.k_unstack
Update the value of 'x' to 'new_x'.k_update
Update the value of 'x' by adding 'increment'.k_update_add
Update the value of 'x' by subtracting 'decrement'.k_update_sub
Variance of a tensor, alongside the specified axis.k_var
Instantiates a variable and returns it.k_variable
Instantiates an all-zeros variable and returns it.k_zeros
Instantiates an all-zeros variable of the same shape as another tensor.k_zeros_like
Main Keras modulekeras
Keras array objectkeras_array
Keras Modelkeras_model
Keras Model composed of a linear stack of layerskeras_model_sequential
Apply an activation function to an output.layer_activation
Exponential Linear Unit.layer_activation_elu
Leaky version of a Rectified Linear Unit.layer_activation_leaky_relu
Parametric Rectified Linear Unit.layer_activation_parametric_relu
Rectified Linear Unit activation functionlayer_activation_relu
Scaled Exponential Linear Unit.layer_activation_selu
Softmax activation function.layer_activation_softmax
Thresholded Rectified Linear Unit.layer_activation_thresholded_relu
Layer that applies an update to the cost function based input activity.layer_activity_regularization
Layer that adds a list of inputs.layer_add
Additive attention layer, a.k.a. Bahdanau-style attentionlayer_additive_attention
Applies Alpha Dropout to the input.layer_alpha_dropout
Dot-product attention layer, a.k.a. Luong-style attentionlayer_attention
Layer that averages a list of inputs.layer_average
Average pooling for temporal data.layer_average_pooling_1d
Average pooling operation for spatial data.layer_average_pooling_2d
Average pooling operation for 3D data (spatial or spatio-temporal).layer_average_pooling_3d
Layer that normalizes its inputslayer_batch_normalization
A preprocessing layer which encodes integer features.layer_category_encoding
Crop the central portion of the images to target height and widthlayer_center_crop
Layer that concatenates a list of inputs.layer_concatenate
1D convolution layer (e.g. temporal convolution).layer_conv_1d
Transposed 1D convolution layer (sometimes called Deconvolution).layer_conv_1d_transpose
2D convolution layer (e.g. spatial convolution over images).layer_conv_2d
Transposed 2D convolution layer (sometimes called Deconvolution).layer_conv_2d_transpose
3D convolution layer (e.g. spatial convolution over volumes).layer_conv_3d
Transposed 3D convolution layer (sometimes called Deconvolution).layer_conv_3d_transpose
1D Convolutional LSTMlayer_conv_lstm_1d
Convolutional LSTM.layer_conv_lstm_2d
3D Convolutional LSTMlayer_conv_lstm_3d
Cropping layer for 1D input (e.g. temporal sequence).layer_cropping_1d
Cropping layer for 2D input (e.g. picture).layer_cropping_2d
Cropping layer for 3D data (e.g. spatial or spatio-temporal).layer_cropping_3d
Add a densely-connected NN layer to an outputlayer_dense
Constructs a DenseFeatures.layer_dense_features
Depthwise 1D convolutionlayer_depthwise_conv_1d
Depthwise separable 2D convolution.layer_depthwise_conv_2d
A preprocessing layer which buckets continuous features by ranges.layer_discretization
Layer that computes a dot product between samples in two tensors.layer_dot
Applies Dropout to the input.layer_dropout
Turns positive integers (indexes) into dense vectors of fixed sizelayer_embedding
Flattens an inputlayer_flatten
Apply multiplicative 1-centered Gaussian noise.layer_gaussian_dropout
Apply additive zero-centered Gaussian noise.layer_gaussian_noise
Global average pooling operation for temporal data.layer_global_average_pooling_1d
Global average pooling operation for spatial data.layer_global_average_pooling_2d
Global Average pooling operation for 3D data.layer_global_average_pooling_3d
Global max pooling operation for temporal data.layer_global_max_pooling_1d
Global max pooling operation for spatial data.layer_global_max_pooling_2d
Global Max pooling operation for 3D data.layer_global_max_pooling_3d
Gated Recurrent Unit - Cho et al.layer_gru
Cell class for the GRU layerlayer_gru_cell
A preprocessing layer which hashes and bins categorical features.layer_hashing
Input layerlayer_input
A preprocessing layer which maps integer features to contiguous ranges.layer_integer_lookup
Wraps arbitrary expression as a layerlayer_lambda
Layer normalization layer (Ba et al., 2016).layer_layer_normalization
Locally-connected layer for 1D inputs.layer_locally_connected_1d
Locally-connected layer for 2D inputs.layer_locally_connected_2d
Long Short-Term Memory unit - Hochreiter 1997.layer_lstm
Cell class for the LSTM layerlayer_lstm_cell
Masks a sequence by using a mask value to skip timesteps.layer_masking
Max pooling operation for temporal data.layer_max_pooling_1d
Max pooling operation for spatial data.layer_max_pooling_2d
Max pooling operation for 3D data (spatial or spatio-temporal).layer_max_pooling_3d
Layer that computes the maximum (element-wise) a list of inputs.layer_maximum
Layer that computes the minimum (element-wise) a list of inputs.layer_minimum
MultiHeadAttention layerlayer_multi_head_attention
Layer that multiplies (element-wise) a list of inputs.layer_multiply
A preprocessing layer which normalizes continuous features.layer_normalization
Permute the dimensions of an input according to a given patternlayer_permute
A preprocessing layer which randomly adjusts brightness during traininglayer_random_brightness
Adjust the contrast of an image or images by a random factorlayer_random_contrast
Randomly crop the images to target height and widthlayer_random_crop
Randomly flip each image horizontally and verticallylayer_random_flip
Randomly vary the height of a batch of images during traininglayer_random_height
Randomly rotate each imagelayer_random_rotation
Randomly translate each image during traininglayer_random_translation
Randomly vary the width of a batch of images during traininglayer_random_width
A preprocessing layer which randomly zooms images during training.layer_random_zoom
Repeats the input n times.layer_repeat_vector
Multiply inputs by 'scale' and adds 'offset'layer_rescaling
Reshapes an output to a certain shape.layer_reshape
Image resizing layerlayer_resizing
Base class for recurrent layerslayer_rnn
Depthwise separable 1D convolution.layer_separable_conv_1d
Separable 2D convolution.layer_separable_conv_2d
Fully-connected RNN where the output is to be fed back to input.layer_simple_rnn
Cell class for SimpleRNNlayer_simple_rnn_cell
Spatial 1D version of Dropout.layer_spatial_dropout_1d
Spatial 2D version of Dropout.layer_spatial_dropout_2d
Spatial 3D version of Dropout.layer_spatial_dropout_3d
Wrapper allowing a stack of RNN cells to behave as a single celllayer_stacked_rnn_cells
A preprocessing layer which maps string features to integer indices.layer_string_lookup
Layer that subtracts two inputs.layer_subtract
A preprocessing layer which maps text features to integer sequences.get_vocabulary layer_text_vectorization set_vocabulary
Unit normalization layerlayer_unit_normalization
Upsampling layer for 1D inputs.layer_upsampling_1d
Upsampling layer for 2D inputs.layer_upsampling_2d
Upsampling layer for 3D inputs.layer_upsampling_3d
Zero-padding layer for 1D input (e.g. temporal sequence).layer_zero_padding_1d
Zero-padding layer for 2D input (e.g. picture).layer_zero_padding_2d
Zero-padding layer for 3D data (spatial or spatio-temporal).layer_zero_padding_3d
A LearningRateSchedule that uses a cosine decay schedulelearning_rate_schedule_cosine_decay
A LearningRateSchedule that uses a cosine decay schedule with restartslearning_rate_schedule_cosine_decay_restarts
A LearningRateSchedule that uses an exponential decay schedulelearning_rate_schedule_exponential_decay
A LearningRateSchedule that uses an inverse time decay schedulelearning_rate_schedule_inverse_time_decay
A LearningRateSchedule that uses a piecewise constant decay schedulelearning_rate_schedule_piecewise_constant_decay
A LearningRateSchedule that uses a polynomial decay schedulelearning_rate_schedule_polynomial_decay
Loss functions"BinaryCrossentropy" "binary_crossentropy", loss-functions loss_binary_crossentropy loss_categorical_crossentropy loss_categorical_hinge loss_cosine_similarity loss_hinge loss_huber loss_kl_divergence loss_kullback_leibler_divergence loss_logcosh loss_mean_absolute_error loss_mean_absolute_percentage_error loss_mean_squared_error loss_mean_squared_logarithmic_error loss_poisson loss_sparse_categorical_crossentropy loss_squared_hinge
Generates a word rank-based probabilistic sampling table.make_sampling_table
MetricMetric
Calculates how often predictions equal labelsmetric_accuracy
Approximates the AUC (Area under the curve) of the ROC or PR curvesmetric_auc
Calculates how often predictions match binary labelsmetric_binary_accuracy
Computes the crossentropy metric between the labels and predictionsmetric_binary_crossentropy
Calculates how often predictions match one-hot labelsmetric_categorical_accuracy
Computes the crossentropy metric between the labels and predictionsmetric_categorical_crossentropy
Computes the categorical hinge metric between 'y_true' and 'y_pred'metric_categorical_hinge
Computes the cosine similarity between the labels and predictionsmetric_cosine_similarity
Calculates the number of false negativesmetric_false_negatives
Calculates the number of false positivesmetric_false_positives
Computes the hinge metric between 'y_true' and 'y_pred'metric_hinge
Computes Kullback-Leibler divergencemetric_kullback_leibler_divergence
Computes the logarithm of the hyperbolic cosine of the prediction errormetric_logcosh_error
Computes the (weighted) mean of the given valuesmetric_mean
Computes the mean absolute error between the labels and predictionsmetric_mean_absolute_error
Computes the mean absolute percentage error between 'y_true' and 'y_pred'metric_mean_absolute_percentage_error
Computes the mean Intersection-Over-Union metricmetric_mean_iou
Computes the mean relative error by normalizing with the given valuesmetric_mean_relative_error
Computes the mean squared error between labels and predictionsmetric_mean_squared_error
Computes the mean squared logarithmic errormetric_mean_squared_logarithmic_error
Computes the element-wise (weighted) mean of the given tensorsmetric_mean_tensor
Wraps a stateless metric function with the Mean metricmetric_mean_wrapper
Computes the Poisson metric between 'y_true' and 'y_pred'metric_poisson
Computes the precision of the predictions with respect to the labelsmetric_precision
Computes best precision where recall is >= specified valuemetric_precision_at_recall
Computes the recall of the predictions with respect to the labelsmetric_recall
Computes best recall where precision is >= specified valuemetric_recall_at_precision
Computes root mean squared error metric between 'y_true' and 'y_pred'metric_root_mean_squared_error
Computes best sensitivity where specificity is >= specified valuemetric_sensitivity_at_specificity
Calculates how often predictions match integer labelsmetric_sparse_categorical_accuracy
Computes the crossentropy metric between the labels and predictionsmetric_sparse_categorical_crossentropy
Computes how often integer targets are in the top 'K' predictionsmetric_sparse_top_k_categorical_accuracy
Computes best specificity where sensitivity is >= specified valuemetric_specificity_at_sensitivity
Computes the squared hinge metricmetric_squared_hinge
Computes the (weighted) sum of the given valuesmetric_sum
Computes how often targets are in the top 'K' predictionsmetric_top_k_categorical_accuracy
Calculates the number of true negativesmetric_true_negatives
Calculates the number of true positivesmetric_true_positives
Load a Keras model from the Saved Model formatmodel_from_saved_model
Model configuration as JSONmodel_from_json model_to_json
Model configuration as YAMLmodel_from_yaml model_to_yaml
Create a new learning rate schedule typenew_learning_rate_schedule_class
Define new keras typesmark_active new_callback_class new_layer_class new_loss_class new_metric_class new_model_class
Normalize a matrix or nd-arraynormalize
Optimizer that implements the Adadelta algorithmoptimizer_adadelta
Optimizer that implements the Adagrad algorithmoptimizer_adagrad
Optimizer that implements the Adam algorithmoptimizer_adam
Optimizer that implements the Adamax algorithmoptimizer_adamax
Optimizer that implements the FTRL algorithmoptimizer_ftrl
Optimizer that implements the Nadam algorithmoptimizer_nadam
Optimizer that implements the RMSprop algorithmoptimizer_rmsprop
Gradient descent (with momentum) optimizeroptimizer_sgd
Pads sequences to the same lengthpad_sequences
Plot training historyplot.keras_training_history
Plot a Keras modelplot.keras.engine.training.Model
Remove the last layer in a modelpop_layer
Returns predictions for a single batch of samples.predict_on_batch
Generate predictions from a Keras modelpredict.keras.engine.training.Model
L1 and L2 regularizationregularizer_l1 regularizer_l1_l2 regularizer_l2
A regularizer that encourages input vectors to be orthogonal to each otherregularizer_orthogonal
Reset the states for a layerreset_states
Save/Load models using HDF5 filesload_model_hdf5 save_model_hdf5
Save/Load models using SavedModel formatload_model_tf save_model_tf
Save/Load model weights using HDF5 filesload_model_weights_hdf5 save_model_weights_hdf5
Save model weights in the SavedModel formatload_model_weights_tf save_model_weights_tf
Save a text tokenizer to an external fileload_text_tokenizer save_text_tokenizer
Convert a list of sequences into a matrix.sequences_to_matrix
sequential_model_input_layersequential_model_input_layer
Serialize a model to an R objectserialize_model unserialize_model
Generates skipgram word pairs.skipgrams
Print a summary of a Keras modelformat.keras.engine.training.Model print.keras.engine.training.Model summary.keras.engine.training.Model
Generate a 'tf.data.Dataset' from text files in a directorytext_dataset_from_directory
Converts a text to a sequence of indexes in a fixed-size hashing space.text_hashing_trick
One-hot encode a text into a list of word indexes in a vocabulary of size n.text_one_hot
Convert text to a sequence of words (or tokens).text_to_word_sequence
Text tokenization utilitytext_tokenizer
Convert a list of texts to a matrix.texts_to_matrix
Transform each text in texts in a sequence of integers.texts_to_sequences
Transforms each text in texts in a sequence of integers.texts_to_sequences_generator
This layer wrapper allows to apply a layer to every temporal slice of an inputtime_distributed
Creates a dataset of sliding windows over a timeseries provided as arraytimeseries_dataset_from_array
Utility function for generating batches of temporal data.timeseries_generator
Converts a class vector (integers) to binary class matrix.to_categorical
Single gradient update or model evaluation over one batch of samples.test_on_batch train_on_batch
Select a Keras implementation and backenduse_backend use_implementation
Provide a scope with mappings of names to custom objectswith_custom_object_scope
zip listszip_lists