tfm.vision.backbones.RevNet

Creates a Reversible ResNet (RevNet) family model.

This implements:

Aidan N. Gomez, Mengye Ren, Raquel Urtasun, Roger B. Grosse. The Reversible Residual Network: Backpropagation Without Storing Activations. (https://arxiv.org/pdf/1707.04585.pdf)

model_id An int of depth/id of ResNet backbone model.
input_specs A tf.keras.layers.InputSpec of the input tensor.
activation A str name of the activation function.
use_sync_bn If True, use synchronized batch normalization.
norm_momentum A float of normalization momentum for the moving average.
norm_epsilon A float added to variance to avoid dividing by zero.
kernel_initializer A str for kernel initializer of convolutional layers.
kernel_regularizer A tf.keras.regularizers.Regularizer object for Conv2D. Default to None.
**kwargs Additional keyword arguments to be passed.

output_specs A dict of {level: TensorShape} pairs for the model output.

Methods

call

Calls the model on new inputs and returns the outputs as tensors.

In this case call() just reapplies all ops in the graph to the new inputs (e.g. build a new computational graph from the provided inputs).

Args
inputs Input tensor, or dict/list/tuple of input tensors.
training Boolean or boolean scalar tensor, indicating whether to run the Network in training mode or inference mode.
mask A mask or list of masks. A mask can be either a boolean tensor or None (no mask). For more details, check the guide here.

Returns
A tensor if there is a single output, or a list of tensors if there are more than one outputs.