R Interface to 'Keras'
Computes the mean absolute percentage error between y_true
and `y_pr...
Computes the mean Intersection-Over-Union metric
(Deprecated) Generates probability or class probability predictions fo...
Objects exported from other packages
L1 and L2 regularization
Computes the mean relative error by normalizing with the given values
Computes the mean squared error between labels and predictions
Computes the mean squared logarithmic error
Computes the element-wise (weighted) mean of the given tensors
Wraps a stateless metric function with the Mean metric
Computes the Poisson metric between y_true
and y_pred
Activation functions
Fits the state of the preprocessing layer to the data being passed
Instantiates the DenseNet architecture.
Instantiates the EfficientNetB0 architecture
Inception-ResNet v2 model, with weights trained on ImageNet
Inception V3 model, with weights pre-trained on ImageNet.
MobileNet model architecture.
MobileNetV2 model architecture
Instantiates the MobileNetV3Large architecture
Instantiates a NASNet model.
Instantiates the ResNet architecture
VGG16 and VGG19 models for Keras.
Instantiates the Xception architecture
Keras backend tensor engine
Bidirectional wrapper for RNNs
Callback to back up and restore the training state
Callback that streams epoch results to a csv file
Stop training when a monitored quantity has stopped improving.
Create a custom callback
Learning rate scheduler.
Save the model after every epoch.
Callback that prints metrics to stdout.
Reduce learning rate when a metric has stopped improving.
Callback used to stream events to a server.
TensorBoard basic visualizations
Callback that terminates training when a NaN loss is encountered.
Clone a model instance.
Configure a Keras model for training
Weight constraints
Count the total number of scalars composing the weights.
Create a Keras Layer
Create a Keras Layer wrapper
(Deprecated) Create a Keras Wrapper
Custom metric function
Boston housing price regression dataset
CIFAR10 small image classification
CIFAR100 small image classification
Fashion-MNIST database of fashion articles
IMDB Movie reviews sentiment classification
MNIST database of handwritten digits
Reuters newswire topics classification
Evaluate a Keras model
(Deprecated) Evaluates the model on a data generator.
Export a Saved Model
Train a Keras model
(Deprecated) Fits the model on data yielded batch-by-batch by a genera...
Fit image data generator internal statistics to some sample data.
Update tokenizer internal vocabulary based on a list of texts or list ...
Generates batches of augmented/normalized data from image data and lab...
Takes the dataframe and the path to a directory and generates batches ...
Generates batches of data from images in a directory (with optional au...
Freeze and unfreeze weights
Retrieve the next item from a generator
Layer/Model configuration
Downloads a file from a URL if it not already in the cache.
Retrieve tensors for layers with multiple nodes
Retrieves a layer based on either its name (unique) or index.
Layer/Model weights as R arrays
Make a python class constructor
Make an Active Binding
Representation of HDF5 dataset to be used instead of an R array
Deprecated Generate batches of image data with real-time data augmenta...
Create a dataset from a directory
Loads an image into PIL format.
3D array representation of images
Decodes the prediction of an ImageNet model.
Preprocesses a tensor or array encoding a batch of images.
Keras implementation
Initializer that generates tensors initialized to a constant value.
Glorot normal initializer, also called Xavier normal initializer.
Glorot uniform initializer, also called Xavier uniform initializer.
He normal initializer.
He uniform variance scaling initializer.
Initializer that generates the identity matrix.
LeCun normal initializer.
LeCun uniform initializer.
Initializer that generates tensors initialized to 1.
Initializer that generates a random orthogonal matrix.
Initializer that generates tensors with a normal distribution.
Initializer that generates tensors with a uniform distribution.
Initializer that generates a truncated normal distribution.
(Deprecated) Generates predictions for the input samples from a data g...
Initializer capable of adapting its scale to the shape of weights.
Initializer that generates tensors initialized to 0.
Install TensorFlow and Keras, including all Python dependencies
Check if Keras is Available
Element-wise absolute value.
Bitwise reduction (logical AND).
Bitwise reduction (logical OR).
Creates a 1D tensor containing a sequence of integers.
Returns the index of the maximum value along an axis.
Returns the index of the minimum value along an axis.
Active Keras backend
Batchwise dot product.
Turn a nD tensor into a 2D tensor with same 1st dimension.
Returns the value of more than one tensor variable.
Returns predictions for a single batch of samples.
Applies batch normalization on x given mean, var, beta and gamma.
Sets the values of many tensor variables at once.
Adds a bias vector to a tensor.
Binary crossentropy between an output tensor and a target tensor.
Casts a tensor to a different dtype and returns it.
Cast an array to the default Keras float type.
Categorical crossentropy between an output tensor and a target tensor.
Destroys the current TF graph and creates a new one.
Element-wise value clipping.
Concatenates a list of tensors alongside the specified axis.
Creates a constant tensor.
1D convolution.
2D convolution.
2D deconvolution (i.e. transposed convolution).
3D convolution.
3D deconvolution (i.e. transposed convolution).
Computes cos of x element-wise.
Returns the static number of elements in a Keras variable or tensor.
Runs CTC loss algorithm on each batch element.
Decodes the output of a softmax.
Converts CTC labels from dense to sparse.
Cumulative product of the values in a tensor, alongside the specified ...
Cumulative sum of the values in a tensor, alongside the specified axis...
Depthwise 2D convolution with separable filters.
Multiplies 2 tensors (and/or variables) and returns a tensor.
Sets entries in x
to zero at random, while scaling the entire tensor...
Returns the dtype of a Keras tensor or variable, as a string.
Exponential linear unit.
Fuzz factor used in numeric expressions.
Element-wise equality between two tensors.
Evaluates the value of a variable.
Element-wise exponential.
Adds a 1-sized dimension at index axis
.
Instantiate an identity matrix and returns it.
Flatten a tensor.
Default float type
Reduce elems using fn to combine them from left to right.
Reduce elems using fn to combine them from right to left.
Instantiates a Keras function
Retrieves the elements of indices indices
in the tensor reference
.
TF session to be used by the backend.
Get the uid for the default graph.
Returns the value of a variable.
Returns the shape of a variable.
Returns the gradients of variables
w.r.t. loss
.
Element-wise truth value of (x > y).
Element-wise truth value of (x >= y).
Segment-wise linear approximation of sigmoid.
Returns a tensor with the same content as the input tensor.
Default image data format convention ('channels_first' or 'channels_la...
Selects x
in test phase, and alt
otherwise.
Returns whether the targets
are in the top k
predictions
.
Selects x
in train phase, and alt
otherwise.
Returns the shape of tensor or variable as a list of int or NULL entri...
Returns whether x
is a Keras tensor.
Returns whether x
is a placeholder.
Returns whether a tensor is a sparse tensor.
Returns whether x
is a symbolic tensor.
Normalizes a tensor wrt the L2 norm alongside the specified axis.
Returns the learning phase flag.
Element-wise truth value of (x < y).
Element-wise truth value of (x <= y).
Apply 1D conv with un-shared weights.
Apply 2D conv with un-shared weights.
Element-wise log.
(Deprecated) Computes log(sum(exp(elements across dimensions of a tens...
Sets the manual variable initialization flag.
Map the function fn over the elements elems and return the outputs.
Maximum value in a tensor.
Element-wise maximum of two tensors.
Mean of a tensor, alongside the specified axis.
Minimum value in a tensor.
Element-wise minimum of two tensors.
Compute the moving average of a variable.
Returns the number of axes in a tensor, as an integer.
Computes mean and std for batch then apply batch_normalization on batc...
Element-wise inequality between two tensors.
Computes the one-hot representation of an integer tensor.
Instantiates an all-ones tensor variable and returns it.
Instantiates an all-ones variable of the same shape as another tensor.
Permutes axes in a tensor.
Instantiates a placeholder tensor and returns it.
2D Pooling.
3D Pooling.
Element-wise exponentiation.
Prints message
and the tensor value when evaluated.
Multiplies the values in a tensor, alongside the specified axis.
Returns a tensor with random binomial distribution of values.
Returns a tensor with normal distribution of values.
Instantiates a variable with values drawn from a normal distribution.
Returns a tensor with uniform distribution of values.
Instantiates a variable with values drawn from a uniform distribution.
Rectified linear unit.
Repeats a 2D tensor.
Repeats the elements of a tensor along an axis.
Reset graph identifiers.
Reshapes a tensor to the specified shape.
Resizes the images contained in a 4D tensor.
Resizes the volume contained in a 5D tensor.
Reverse a tensor along the specified axes.
Iterates over the time dimension of a tensor
Element-wise rounding to the closest integer.
2D convolution with separable filters.
Sets the learning phase to a fixed value.
Sets the value of a variable, from an R array.
Returns the symbolic shape of a tensor or variable.
Element-wise sigmoid.
Element-wise sign.
Computes sin of x element-wise.
Softmax of a tensor.
Softplus of a tensor.
Softsign of a tensor.
Categorical crossentropy with integer targets.
Pads the 2nd and 3rd dimensions of a 4D tensor.
Pads 5D tensor with zeros along the depth, height, width dimensions.
Element-wise square root.
Element-wise square.
Removes a 1-dimension from the tensor at index axis
.
Stacks a list of rank R
tensors into a rank R+1
tensor.
Standard deviation of a tensor, alongside the specified axis.
Returns variables
but with zero gradient w.r.t. every other variable...
Sum of the values in a tensor, alongside the specified axis.
Switches between two operations depending on a scalar value.
Element-wise tanh.
Pads the middle dimension of a 3D tensor.
Creates a tensor by tiling x
by n
.
Converts a sparse tensor into a dense tensor and returns it.
Transposes a tensor and returns it.
Returns a tensor with truncated random normal distribution of values.
Unstack rank R
tensor into a list of rank R-1
tensors.
Update the value of x
to new_x
.
Update the value of x
by adding increment
.
Update the value of x
by subtracting decrement
.
Variance of a tensor, alongside the specified axis.
Instantiates a variable and returns it.
Instantiates an all-zeros variable and returns it.
Instantiates an all-zeros variable of the same shape as another tensor...
R interface to Keras
Main Keras module
Keras array object
Keras Model
(Deprecated) Create a Keras custom model
Keras Model composed of a linear stack of layers
(Deprecated) Base R6 class for Keras callbacks
(Deprecated) Base R6 class for Keras constraints
(Deprecated) Base R6 class for Keras layers
(Deprecated) Base R6 class for Keras wrappers
(Deprecated) Create a custom Layer
Apply an activation function to an output.
Exponential Linear Unit.
Leaky version of a Rectified Linear Unit.
Parametric Rectified Linear Unit.
Rectified Linear Unit activation function
Scaled Exponential Linear Unit.
Softmax activation function.
Thresholded Rectified Linear Unit.
Layer that applies an update to the cost function based input activity...
Layer that adds a list of inputs.
Additive attention layer, a.k.a. Bahdanau-style attention
Applies Alpha Dropout to the input.
Dot-product attention layer, a.k.a. Luong-style attention
Layer that averages a list of inputs.
Average pooling for temporal data.
Average pooling operation for spatial data.
Average pooling operation for 3D data (spatial or spatio-temporal).
Layer that normalizes its inputs
A preprocessing layer which encodes integer features.
Crop the central portion of the images to target height and width
Layer that concatenates a list of inputs.
1D convolution layer (e.g. temporal convolution).
Transposed 1D convolution layer (sometimes called Deconvolution).
2D convolution layer (e.g. spatial convolution over images).
Transposed 2D convolution layer (sometimes called Deconvolution).
3D convolution layer (e.g. spatial convolution over volumes).
Transposed 3D convolution layer (sometimes called Deconvolution).
1D Convolutional LSTM
Convolutional LSTM.
3D Convolutional LSTM
Cropping layer for 1D input (e.g. temporal sequence).
Cropping layer for 2D input (e.g. picture).
Cropping layer for 3D data (e.g. spatial or spatio-temporal).
(Deprecated) Fast GRU implementation backed by [CuDNN](https://develop...
(Deprecated) Fast LSTM implementation backed by [CuDNN](https://develo...
Add a densely-connected NN layer to an output
Constructs a DenseFeatures.
Depthwise 1D convolution
Depthwise separable 2D convolution.
A preprocessing layer which buckets continuous features by ranges.
Layer that computes a dot product between samples in two tensors.
Applies Dropout to the input.
Turns positive integers (indexes) into dense vectors of fixed size
Flattens an input
Apply multiplicative 1-centered Gaussian noise.
Apply additive zero-centered Gaussian noise.
Global average pooling operation for temporal data.
Global average pooling operation for spatial data.
Global Average pooling operation for 3D data.
Global max pooling operation for temporal data.
Global max pooling operation for spatial data.
Global Max pooling operation for 3D data.
Gated Recurrent Unit - Cho et al.
Cell class for the GRU layer
A preprocessing layer which hashes and bins categorical features.
Input layer
A preprocessing layer which maps integer features to contiguous ranges...
Wraps arbitrary expression as a layer
Layer normalization layer (Ba et al., 2016).
Locally-connected layer for 1D inputs.
Locally-connected layer for 2D inputs.
Long Short-Term Memory unit - Hochreiter 1997.
Cell class for the LSTM layer
Masks a sequence by using a mask value to skip timesteps.
Max pooling operation for temporal data.
Max pooling operation for spatial data.
Max pooling operation for 3D data (spatial or spatio-temporal).
Layer that computes the maximum (element-wise) a list of inputs.
Layer that computes the minimum (element-wise) a list of inputs.
MultiHeadAttention layer
Layer that multiplies (element-wise) a list of inputs.
A preprocessing layer which normalizes continuous features.
Permute the dimensions of an input according to a given pattern
A preprocessing layer which randomly adjusts brightness during trainin...
Adjust the contrast of an image or images by a random factor
Randomly crop the images to target height and width
Randomly flip each image horizontally and vertically
Randomly vary the height of a batch of images during training
Randomly rotate each image
Randomly translate each image during training
Randomly vary the width of a batch of images during training
A preprocessing layer which randomly zooms images during training.
Repeats the input n times.
Multiply inputs by scale
and adds offset
Reshapes an output to a certain shape.
Image resizing layer
Base class for recurrent layers
Depthwise separable 1D convolution.
Separable 2D convolution.
Fully-connected RNN where the output is to be fed back to input.
Cell class for SimpleRNN
Spatial 1D version of Dropout.
Spatial 2D version of Dropout.
Spatial 3D version of Dropout.
Wrapper allowing a stack of RNN cells to behave as a single cell
A preprocessing layer which maps string features to integer indices.
Layer that subtracts two inputs.
A preprocessing layer which maps text features to integer sequences.
Unit normalization layer
Upsampling layer for 1D inputs.
Upsampling layer for 2D inputs.
Upsampling layer for 3D inputs.
Zero-padding layer for 1D input (e.g. temporal sequence).
Zero-padding layer for 2D input (e.g. picture).
Zero-padding layer for 3D data (spatial or spatio-temporal).
A LearningRateSchedule that uses a cosine decay schedule
A LearningRateSchedule that uses a cosine decay schedule with restarts
A LearningRateSchedule that uses an exponential decay schedule
A LearningRateSchedule that uses an inverse time decay schedule
A LearningRateSchedule that uses a piecewise constant decay schedule
A LearningRateSchedule that uses a polynomial decay schedule
Loss functions
(Deprecated) loss_cosine_proximity
Generates a word rank-based probabilistic sampling table.
metric-or-Metric
Metric
Calculates how often predictions equal labels
Approximates the AUC (Area under the curve) of the ROC or PR curves
Calculates how often predictions match binary labels
Computes the crossentropy metric between the labels and predictions
Calculates how often predictions match one-hot labels
Computes the crossentropy metric between the labels and predictions
Computes the categorical hinge metric between y_true
and y_pred
(Deprecated) metric_cosine_proximity
Computes the cosine similarity between the labels and predictions
Calculates the number of false negatives
Calculates the number of false positives
Computes the hinge metric between y_true
and y_pred
Computes Kullback-Leibler divergence
Computes the logarithm of the hyperbolic cosine of the prediction erro...
Computes the (weighted) mean of the given values
Computes the mean absolute error between the labels and predictions
Computes the precision of the predictions with respect to the labels
Computes best precision where recall is >= specified value
Computes the recall of the predictions with respect to the labels
Computes best recall where precision is >= specified value
Computes root mean squared error metric between y_true
and y_pred
Computes best sensitivity where specificity is >= specified value
Calculates how often predictions match integer labels
Computes the crossentropy metric between the labels and predictions
Computes how often integer targets are in the top K
predictions
Computes best specificity where sensitivity is >= specified value
Computes the squared hinge metric
Computes the (weighted) sum of the given values
Computes how often targets are in the top K
predictions
Calculates the number of true negatives
Calculates the number of true positives
Load a Keras model from the Saved Model format
Model configuration as JSON
(Deprecated) Export to Saved Model format
Model configuration as YAML
Assign values to names
(Deprecated) Replicates a model on different GPUs.
Define new keras types
Create a new learning rate schedule type
Normalize a matrix or nd-array
Optimizer that implements the Adadelta algorithm
Optimizer that implements the Adagrad algorithm
Optimizer that implements the Adam algorithm
Optimizer that implements the Adamax algorithm
Optimizer that implements the FTRL algorithm
Optimizer that implements the Nadam algorithm
Optimizer that implements the RMSprop algorithm
Gradient descent (with momentum) optimizer
Pads sequences to the same length
Pipe operator
Plot a Keras model
Plot training history
Remove the last layer in a model
Generate predictions from a Keras model
A regularizer that encourages input vectors to be orthogonal to each o...
Reset the states for a layer
Save/Load models using HDF5 files
Save/Load models using SavedModel format
Save/Load model weights using HDF5 files
Save model weights in the SavedModel format
Save a text tokenizer to an external file
Convert a list of sequences into a matrix.
sequential_model_input_layer
Serialize a model to an R object
Generates skipgram word pairs.
Print a summary of a Keras model
Generate a tf.data.Dataset
from text files in a directory
Converts a text to a sequence of indexes in a fixed-size hashing space...
One-hot encode a text into a list of word indexes in a vocabulary of s...
Convert text to a sequence of words (or tokens).
Text tokenization utility
Convert a list of texts to a matrix.
Transform each text in texts in a sequence of integers.
Transforms each text in texts in a sequence of integers.
This layer wrapper allows to apply a layer to every temporal slice of ...
Creates a dataset of sliding windows over a timeseries provided as arr...
Utility function for generating batches of temporal data.
Converts a class vector (integers) to binary class matrix.
Single gradient update or model evaluation over one batch of samples.
Select a Keras implementation and backend
Provide a scope with mappings of names to custom objects
zip lists
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.
Useful links