# keras v2.3.0.0

0

Monthly downloads

## 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.

## Functions in keras

Name | Description | |

callback_model_checkpoint | Save the model after every epoch. | |

application_mobilenet_v2 | MobileNetV2 model architecture | |

dataset_fashion_mnist | Fashion-MNIST database of fashion articles | |

dataset_imdb | IMDB Movie reviews sentiment classification | |

application_nasnet | Instantiates a NASNet model. | |

callback_terminate_on_naan | Callback that terminates training when a NaN loss is encountered. | |

clone_model | Clone a model instance. | |

export_savedmodel.keras.engine.training.Model | Export a Saved Model | |

dataset_cifar100 | CIFAR100 small image classification | |

dataset_cifar10 | CIFAR10 small image classification | |

KerasConstraint | Base R6 class for Keras constraints | |

KerasLayer | Base R6 class for Keras layers | |

application_xception | Xception V1 model for Keras. | |

adapt | Fits the state of the preprocessing layer to the data being passed. | |

callback_lambda | Create a custom callback | |

activation_relu | Activation functions | |

callback_early_stopping | Stop training when a monitored quantity has stopped improving. | |

create_layer | Create a Keras Layer | |

flow_images_from_directory | Generates batches of data from images in a directory (with optional augmented/normalized data) | |

count_params | Count the total number of scalars composing the weights. | |

flow_images_from_dataframe | Takes the dataframe and the path to a directory and generates batches of augmented/normalized data. | |

initializer_glorot_normal | Glorot normal initializer, also called Xavier normal initializer. | |

get_input_at | Retrieve tensors for layers with multiple nodes | |

backend | Keras backend tensor engine | |

get_layer | Retrieves a layer based on either its name (unique) or index. | |

callback_tensorboard | TensorBoard basic visualizations | |

implementation | Keras implementation | |

callback_remote_monitor | Callback used to stream events to a server. | |

fit.keras.engine.training.Model | Train a Keras model | |

get_config | Layer/Model configuration | |

initializer_glorot_uniform | Glorot uniform initializer, also called Xavier uniform initializer. | |

constraints | Weight constraints | |

compile.keras.engine.training.Model | Configure a Keras model for training | |

create_wrapper | Create a Keras Wrapper | |

initializer_constant | Initializer that generates tensors initialized to a constant value. | |

k_concatenate | Concatenates a list of tensors alongside the specified axis. | |

install_keras | Install Keras and the TensorFlow backend | |

is_keras_available | Check if Keras is Available | |

k_clip | Element-wise value clipping. | |

k_cumsum | Cumulative sum of the values in a tensor, alongside the specified axis. | |

get_file | Downloads a file from a URL if it not already in the cache. | |

initializer_variance_scaling | Initializer capable of adapting its scale to the shape of weights. | |

dataset_boston_housing | Boston housing price regression dataset | |

initializer_zeros | Initializer that generates tensors initialized to 0. | |

initializer_orthogonal | Initializer that generates a random orthogonal matrix. | |

KerasWrapper | Base R6 class for Keras wrappers | |

dataset_mnist | MNIST database of handwritten digits | |

application_resnet50 | ResNet50 model for Keras. | |

k_depthwise_conv2d | Depthwise 2D convolution with separable filters. | |

application_vgg | VGG16 and VGG19 models for Keras. | |

k_flatten | Flatten a tensor. | |

initializer_random_normal | Initializer that generates tensors with a normal distribution. | |

k_argmax | Returns the index of the maximum value along an axis. | |

k_abs | Element-wise absolute value. | |

fit_text_tokenizer | Update tokenizer internal vocabulary based on a list of texts or list of sequences. | |

dataset_reuters | Reuters newswire topics classification | |

flow_images_from_data | Generates batches of augmented/normalized data from image data and labels | |

k_argmin | Returns the index of the minimum value along an axis. | |

k_clear_session | Destroys the current TF graph and creates a new one. | |

k_dtype | Returns the dtype of a Keras tensor or variable, as a string. | |

k_floatx | Default float type | |

k_categorical_crossentropy | Categorical crossentropy between an output tensor and a target tensor. | |

get_vocabulary | Get the vocabulary for text vectorization layers | |

k_elu | Exponential linear unit. | |

fit_generator | Fits the model on data yielded batch-by-batch by a generator. | |

callback_progbar_logger | Callback that prints metrics to stdout. | |

callback_reduce_lr_on_plateau | Reduce learning rate when a metric has stopped improving. | |

fit_image_data_generator | Fit image data generator internal statistics to some sample data. | |

k_in_top_k | Returns whether the targets are in the top k predictions. | |

k_in_test_phase | Selects x in test phase, and alt otherwise. | |

k_get_value | Returns the value of a variable. | |

k_is_sparse | Returns whether a tensor is a sparse tensor. | |

k_get_variable_shape | Returns the shape of a variable. | |

k_is_tensor | Returns whether x is a symbolic tensor. | |

evaluate_generator | Evaluates the model on a data generator. | |

k_log | Element-wise log. | |

evaluate.keras.engine.training.Model | Evaluate a Keras model | |

get_weights | Layer/Model weights as R arrays | |

hdf5_matrix | Representation of HDF5 dataset to be used instead of an R array | |

image_data_generator | Generate batches of image data with real-time data augmentation. The data will be looped over (in batches). | |

k_all | Bitwise reduction (logical AND). | |

freeze_weights | Freeze and unfreeze weights | |

generator_next | Retrieve the next item from a generator | |

initializer_he_uniform | He uniform variance scaling initializer. | |

initializer_he_normal | He normal initializer. | |

imagenet_decode_predictions | Decodes the prediction of an ImageNet model. | |

k_normalize_batch_in_training | Computes mean and std for batch then apply batch_normalization on batch. | |

k_prod | Multiplies the values in a tensor, alongside the specified axis. | |

k_ndim | Returns the number of axes in a tensor, as an integer. | |

k_random_binomial | Returns a tensor with random binomial distribution of values. | |

k_repeat_elements | Repeats the elements of a tensor along an axis. | |

k_reset_uids | Reset graph identifiers. | |

imagenet_preprocess_input | Preprocesses a tensor or array encoding a batch of images. | |

initializer_identity | Initializer that generates the identity matrix. | |

k_sigmoid | Element-wise sigmoid. | |

initializer_lecun_normal | LeCun normal initializer. | |

k_batch_flatten | Turn a nD tensor into a 2D tensor with same 1st dimension. | |

k_batch_get_value | Returns the value of more than one tensor variable. | |

k_sign | Element-wise sign. | |

initializer_lecun_uniform | LeCun uniform initializer. | |

k_logsumexp | Computes log(sum(exp(elements across dimensions of a tensor))). | |

initializer_ones | Initializer that generates tensors initialized to 1. | |

image_to_array | 3D array representation of images | |

image_load | Loads an image into PIL format. | |

initializer_random_uniform | Initializer that generates tensors with a uniform distribution. | |

k_conv3d | 3D convolution. | |

k_bias_add | Adds a bias vector to a tensor. | |

k_constant | Creates a constant tensor. | |

k_conv1d | 1D convolution. | |

k_eval | Evaluates the value of a variable. | |

k_binary_crossentropy | Binary crossentropy between an output tensor and a target tensor. | |

k_exp | Element-wise exponential. | |

k_any | Bitwise reduction (logical OR). | |

k_sin | Computes sin of x element-wise. | |

k_pool2d | 2D Pooling. | |

k_function | Instantiates a Keras function | |

k_softmax | Softmax of a tensor. | |

k_backend | Active Keras backend | |

k_batch_dot | Batchwise dot product. | |

initializer_truncated_normal | Initializer that generates a truncated normal distribution. | |

k_batch_set_value | Sets the values of many tensor variables at once. | |

k_conv2d_transpose | 2D deconvolution (i.e. transposed convolution). | |

k_arange | Creates a 1D tensor containing a sequence of integers. | |

k_conv2d | 2D convolution. | |

k_batch_normalization | Applies batch normalization on x given mean, var, beta and gamma. | |

k_conv3d_transpose | 3D deconvolution (i.e. transposed convolution). | |

k_cast | Casts a tensor to a different dtype and returns it. | |

k_pool3d | 3D Pooling. | |

k_reshape | Reshapes a tensor to the specified shape. | |

k_ctc_batch_cost | Runs CTC loss algorithm on each batch element. | |

k_temporal_padding | Pads the middle dimension of a 3D tensor. | |

k_dot | Multiplies 2 tensors (and/or variables) and returns a tensor. | |

k_greater_equal | Element-wise truth value of (x >= y). | |

k_foldl | Reduce elems using fn to combine them from left to right. | |

k_foldr | Reduce elems using fn to combine them from right to left. | |

k_hard_sigmoid | Segment-wise linear approximation of sigmoid. | |

k_dropout | Sets entries in x to zero at random, while scaling the entire tensor. | |

k_ctc_decode | Decodes the output of a softmax. | |

k_equal | Element-wise equality between two tensors. | |

k_epsilon | Fuzz factor used in numeric expressions. | |

k_in_train_phase | Selects x in train phase, and alt otherwise. | |

k_get_session | TF session to be used by the backend. | |

k_cast_to_floatx | Cast an array to the default Keras float type. | |

k_cumprod | Cumulative product of the values in a tensor, alongside the specified axis. | |

k_ctc_label_dense_to_sparse | Converts CTC labels from dense to sparse. | |

k_cos | Computes cos of x element-wise. | |

k_expand_dims | Adds a 1-sized dimension at index axis. | |

k_identity | Returns a tensor with the same content as the input tensor. | |

k_count_params | Returns the static number of elements in a Keras variable or tensor. | |

k_get_uid | Get the uid for the default graph. | |

k_image_data_format | Default image data format convention ('channels_first' or 'channels_last'). | |

k_tile | Creates a tensor by tiling x by n. | |

k_manual_variable_initialization | Sets the manual variable initialization flag. | |

k_eye | Instantiate an identity matrix and returns it. | |

k_is_placeholder | Returns whether x is a placeholder. | |

k_gather | Retrieves the elements of indices indices in the tensor reference. | |

k_minimum | Element-wise minimum of two tensors. | |

k_less_equal | Element-wise truth value of (x <= y). | |

k_less | Element-wise truth value of (x < y). | |

k_moving_average_update | Compute the moving average of a variable. | |

k_pow | Element-wise exponentiation. | |

k_is_keras_tensor | Returns whether x is a Keras tensor. | |

k_var | Variance of a tensor, alongside the specified axis. | |

k_int_shape | Returns the shape of tensor or variable as a list of int or NULL entries. | |

k_print_tensor | Prints message and the tensor value when evaluated. | |

k_resize_images | Resizes the images contained in a 4D tensor. | |

k_local_conv1d | Apply 1D conv with un-shared weights. | |

k_std | Standard deviation of a tensor, alongside the specified axis. | |

k_square | Element-wise square. | |

k_rnn | Iterates over the time dimension of a tensor | |

k_squeeze | Removes a 1-dimension from the tensor at index axis. | |

k_stack | Stacks a list of rank R tensors into a rank R+1 tensor. | |

k_round | Element-wise rounding to the closest integer. | |

k_zeros | Instantiates an all-zeros variable and returns it. | |

k_gradients | Returns the gradients of variables w.r.t. loss. | |

k_greater | Element-wise truth value of (x > y). | |

k_local_conv2d | Apply 2D conv with un-shared weights. | |

k_zeros_like | Instantiates an all-zeros variable of the same shape as another tensor. | |

k_reverse | Reverse a tensor along the specified axes. | |

k_repeat | Repeats a 2D tensor. | |

k_resize_volumes | Resizes the volume contained in a 5D tensor. | |

k_relu | Rectified linear unit. | |

k_softplus | Softplus of a tensor. | |

layer_activation | Apply an activation function to an output. | |

layer_attention | Creates attention layer | |

keras_model_sequential | Keras Model composed of a linear stack of layers | |

k_map_fn | Map the function fn over the elements elems and return the outputs. | |

layer_average | Layer that averages a list of inputs. | |

k_mean | Mean of a tensor, alongside the specified axis. | |

layer_conv_2d | 2D convolution layer (e.g. spatial convolution over images). | |

k_permute_dimensions | Permutes axes in a tensor. | |

k_separable_conv2d | 2D convolution with separable filters. | |

k_max | Maximum value in a tensor. | |

k_maximum | Element-wise maximum of two tensors. | |

k_placeholder | Instantiates a placeholder tensor and returns it. | |

k_set_learning_phase | Sets the learning phase to a fixed value. | |

k_sqrt | Element-wise square root. | |

k_spatial_3d_padding | Pads 5D tensor with zeros along the depth, height, width dimensions. | |

k_min | Minimum value in a tensor. | |

k_random_uniform | Returns a tensor with uniform distribution of values. | |

k_l2_normalize | Normalizes a tensor wrt the L2 norm alongside the specified axis. | |

k_softsign | Softsign of a tensor. | |

layer_flatten | Flattens an input | |

layer_cropping_1d | Cropping layer for 1D input (e.g. temporal sequence). | |

layer_gaussian_dropout | Apply multiplicative 1-centered Gaussian noise. | |

layer_activation_relu | Rectified Linear Unit activation function | |

k_variable | Instantiates a variable and returns it. | |

layer_global_max_pooling_1d | Global max pooling operation for temporal data. | |

layer_activation_parametric_relu | Parametric Rectified Linear Unit. | |

layer_conv_lstm_2d | Convolutional LSTM. | |

k_random_uniform_variable | Instantiates a variable with values drawn from a uniform distribution. | |

layer_global_max_pooling_2d | Global max pooling operation for spatial data. | |

k_stop_gradient | Returns variables but with zero gradient w.r.t. every other variable. | |

k_one_hot | Computes the one-hot representation of an integer tensor. | |

k_ones_like | Instantiates an all-ones variable of the same shape as another tensor. | |

k_random_normal_variable | Instantiates a variable with values drawn from a normal distribution. | |

k_not_equal | Element-wise inequality between two tensors. | |

k_learning_phase | Returns the learning phase flag. | |

k_to_dense | Converts a sparse tensor into a dense tensor and returns it. | |

k_transpose | Transposes a tensor and returns it. | |

k_random_normal | Returns a tensor with normal distribution of values. | |

k_ones | Instantiates an all-ones tensor variable and returns it. | |

k_sum | Sum of the values in a tensor, alongside the specified axis. | |

k_set_value | Sets the value of a variable, from an R array. | |

layer_activation_leaky_relu | Leaky version of a Rectified Linear Unit. | |

k_update_add | Update the value of x by adding increment. | |

layer_activation_elu | Exponential Linear Unit. | |

layer_input | Input layer | |

k_update_sub | Update the value of x by subtracting decrement. | |

layer_lambda | Wraps arbitrary expression as a layer | |

layer_average_pooling_1d | Average pooling for temporal data. | |

layer_average_pooling_2d | Average pooling operation for spatial data. | |

layer_locally_connected_1d | Locally-connected layer for 1D inputs. | |

layer_max_pooling_3d | Max pooling operation for 3D data (spatial or spatio-temporal). | |

k_truncated_normal | Returns a tensor with truncated random normal distribution of values. | |

make_sampling_table | Generates a word rank-based probabilistic sampling table. | |

keras_array | Keras array object | |

k_shape | Returns the symbolic shape of a tensor or variable. | |

layer_separable_conv_1d | Depthwise separable 1D convolution. | |

keras-package | R interface to Keras | |

k_sparse_categorical_crossentropy | Categorical crossentropy with integer targets. | |

layer_maximum | Layer that computes the maximum (element-wise) a list of inputs. | |

layer_reshape | Reshapes an output to a certain shape. | |

k_spatial_2d_padding | Pads the 2nd and 3rd dimensions of a 4D tensor. | |

layer_average_pooling_3d | Average pooling operation for 3D data (spatial or spatio-temporal). | |

k_switch | Switches between two operations depending on a scalar value. | |

layer_dropout | Applies Dropout to the input. | |

layer_conv_2d_transpose | Transposed 2D convolution layer (sometimes called Deconvolution). | |

layer_global_average_pooling_2d | Global average pooling operation for spatial data. | |

layer_global_average_pooling_3d | Global Average pooling operation for 3D data. | |

layer_embedding | Turns positive integers (indexes) into dense vectors of fixed size. | |

keras_model | Keras Model | |

keras_model_custom | Create a Keras custom model | |

k_update | Update the value of x to new_x. | |

layer_locally_connected_2d | Locally-connected layer for 2D inputs. | |

layer_add | Layer that adds a list of inputs. | |

layer_lstm | Long Short-Term Memory unit - Hochreiter 1997. | |

layer_activation_selu | Scaled Exponential Linear Unit. | |

layer_spatial_dropout_3d | Spatial 3D version of Dropout. | |

layer_subtract | Layer that subtracts two inputs. | |

layer_masking | Masks a sequence by using a mask value to skip timesteps. | |

layer_zero_padding_1d | Zero-padding layer for 1D input (e.g. temporal sequence). | |

%<-% | Assign values to names | |

metric_binary_accuracy | Model performance metrics | |

multi_gpu_model | Replicates a model on different GPUs. | |

layer_activation_softmax | Softmax activation function. | |

layer_activation_thresholded_relu | Thresholded Rectified Linear Unit. | |

layer_cropping_2d | Cropping layer for 2D input (e.g. picture). | |

layer_cudnn_gru | Fast GRU implementation backed by CuDNN. | |

layer_cropping_3d | Cropping layer for 3D data (e.g. spatial or spatio-temporal). | |

layer_activity_regularization | Layer that applies an update to the cost function based input activity. | |

layer_cudnn_lstm | Fast LSTM implementation backed by CuDNN. | |

layer_text_vectorization | Text vectorization layer | |

layer_batch_normalization | Batch normalization layer (Ioffe and Szegedy, 2014). | |

predict_proba | Generates probability or class probability predictions for the input samples. | |

pad_sequences | Pads sequences to the same length | |

predict_on_batch | Returns predictions for a single batch of samples. | |

%>% | Pipe operator | |

layer_zero_padding_2d | Zero-padding layer for 2D input (e.g. picture). | |

layer_max_pooling_1d | Max pooling operation for temporal data. | |

model_from_saved_model | Load a Keras model from the Saved Model format | |

model_to_json | Model configuration as JSON | |

layer_max_pooling_2d | Max pooling operation for spatial data. | |

layer_permute | Permute the dimensions of an input according to a given pattern | |

layer_concatenate | Layer that concatenates a list of inputs. | |

predict.keras.engine.training.Model | Generate predictions from a Keras model | |

layer_alpha_dropout | Applies Alpha Dropout to the input. | |

layer_conv_3d | 3D convolution layer (e.g. spatial convolution over volumes). | |

layer_upsampling_1d | Upsampling layer for 1D inputs. | |

layer_upsampling_2d | Upsampling layer for 2D inputs. | |

layer_repeat_vector | Repeats the input n times. | |

layer_upsampling_3d | Upsampling layer for 3D inputs. | |

layer_conv_1d | 1D convolution layer (e.g. temporal convolution). | |

normalize | Normalize a matrix or nd-array | |

optimizer_adadelta | Adadelta optimizer. | |

layer_depthwise_conv_2d | Depthwise separable 2D convolution. | |

optimizer_adamax | Adamax optimizer | |

layer_dot | Layer that computes a dot product between samples in two tensors. | |

layer_global_max_pooling_3d | Global Max pooling operation for 3D data. | |

layer_conv_3d_transpose | Transposed 3D convolution layer (sometimes called Deconvolution). | |

model_to_yaml | Model configuration as YAML | |

model_to_saved_model | Export to Saved Model format | |

layer_dense | Add a densely-connected NN layer to an output | |

layer_gaussian_noise | Apply additive zero-centered Gaussian noise. | |

layer_global_average_pooling_1d | Global average pooling operation for temporal data. | |

layer_separable_conv_2d | Separable 2D convolution. | |

layer_dense_features | Constructs a DenseFeatures. | |

pop_layer | Remove the last layer in a model | |

layer_simple_rnn | Fully-connected RNN where the output is to be fed back to input. | |

layer_zero_padding_3d | Zero-padding layer for 3D data (spatial or spatio-temporal). | |

plot.keras_training_history | Plot training history | |

loss_mean_squared_error | Model loss functions | |

layer_gru | Gated Recurrent Unit - Cho et al. | |

save_text_tokenizer | Save a text tokenizer to an external file | |

texts_to_matrix | Convert a list of texts to a matrix. | |

layer_minimum | Layer that computes the minimum (element-wise) a list of inputs. | |

save_model_weights_tf | Save model weights in the SavedModel format | |

text_tokenizer | Text tokenization utility | |

optimizer_nadam | Nesterov Adam optimizer | |

predict_generator | Generates predictions for the input samples from a data generator. | |

time_distributed | Apply a layer to every temporal slice of an input. | |

optimizer_adagrad | Adagrad optimizer. | |

optimizer_sgd | Stochastic gradient descent optimizer | |

optimizer_rmsprop | RMSProp optimizer | |

optimizer_adam | Adam optimizer | |

layer_multiply | Layer that multiplies (element-wise) a list of inputs. | |

layer_spatial_dropout_1d | Spatial 1D version of Dropout. | |

timeseries_generator | Utility function for generating batches of temporal data. | |

layer_spatial_dropout_2d | Spatial 2D version of Dropout. | |

save_model_tf | Save/Load models using SavedModel format | |

skipgrams | Generates skipgram word pairs. | |

save_model_weights_hdf5 | Save/Load model weights using HDF5 files | |

train_on_batch | Single gradient update or model evaluation over one batch of samples. | |

set_vocabulary | Sets vocabulary (and optionally document frequency) data for the layer | |

to_categorical | Converts a class vector (integers) to binary class matrix. | |

summary.keras.engine.training.Model | Print a summary of a Keras model | |

sequences_to_matrix | Convert a list of sequences into a matrix. | |

regularizer_l1 | L1 and L2 regularization | |

with_custom_object_scope | Provide a scope with mappings of names to custom objects | |

use_implementation | Select a Keras implementation and backend | |

reexports | Objects exported from other packages | |

serialize_model | Serialize a model to an R object | |

reset_states | Reset the states for a layer | |

text_hashing_trick | Converts a text to a sequence of indexes in a fixed-size hashing space. | |

save_model_hdf5 | Save/Load models using HDF5 files | |

texts_to_sequences | Transform each text in texts in a sequence of integers. | |

texts_to_sequences_generator | Transforms each text in texts in a sequence of integers. | |

text_one_hot | One-hot encode a text into a list of word indexes in a vocabulary of size n. | |

text_to_word_sequence | Convert text to a sequence of words (or tokens). | |

application_inception_v3 | Inception V3 model, with weights pre-trained on ImageNet. | |

application_mobilenet | MobileNet model architecture. | |

KerasCallback | Base R6 class for Keras callbacks | |

application_densenet | Instantiates the DenseNet architecture. | |

application_inception_resnet_v2 | Inception-ResNet v2 model, with weights trained on ImageNet | |

callback_learning_rate_scheduler | Learning rate scheduler. | |

bidirectional | Bidirectional wrapper for RNNs. | |

callback_csv_logger | Callback that streams epoch results to a csv file | |

k_tanh | Element-wise tanh. | |

No Results! |

## Vignettes of keras

## Last month downloads

## Details

Type | Package |

Encoding | UTF-8 |

License | MIT + file LICENSE |

URL | https://keras.rstudio.com |

BugReports | https://github.com/rstudio/keras/issues |

SystemRequirements | Keras >= 2.0 (https://keras.io) |

RoxygenNote | 7.0.2 |

VignetteBuilder | knitr |

NeedsCompilation | no |

Packaged | 2020-05-19 18:26:18 UTC; dfalbel |

Repository | CRAN |

Date/Publication | 2020-05-19 20:30:02 UTC |

imports | generics (>= 0.0.1) , magrittr , methods , R6 , reticulate (>= 1.10) , tensorflow (>= 2.0.0) , tfruns (>= 1.0) , zeallot |

suggests | ggplot2 , jpeg , knitr , rmarkdown , testthat (>= 2.1.0) , tfdatasets |

depends | R (>= 3.2) |

Contributors | Yuan Tang, JJ Allaire, RStudio, Fran<c3><a7>ois Chollet, Google, Wouter Van Der Bijl, Martin Studer, Sigrid Keydana |

#### Include our badge in your README

```
[![Rdoc](http://www.rdocumentation.org/badges/version/keras)](http://www.rdocumentation.org/packages/keras)
```