layer_contextual_attention_2d: Contextual attention layer (2-D and 3-D)

View source: R/createInpaintingDeepFillModel.R

layer_contextual_attention_2dR Documentation

Contextual attention layer (2-D and 3-D)

Description

Contextual attention layer for generative image inpainting described in

Usage

layer_contextual_attention_2d(
  object,
  kernelSize = 3L,
  stride = 1L,
  dilationRate = 1L,
  fusionKernelSize = 0L,
  name = NULL,
  trainable = FALSE
)

layer_contextual_attention_3d(
  object,
  kernelSize = 3L,
  stride = 1L,
  dilationRate = 1L,
  fusionKernelSize = 0L,
  name = NULL,
  trainable = FALSE
)

Arguments

object

Object to compose layer with. This is either a keras::keras_model_sequential to add the layer to, or another Layer which this layer will call.

kernelSize

integer specifying convolution size

stride

integer for specifyingstride length for sampling the tensor

dilationRate

ingeger specifying dilation

fusionKernelSize

Enhance saliency of large patches

name

The name of the layer

trainable

Whether the layer weights will be updated during training.

Details

Jiahui Yu, et al., Generative Image Inpainting with Contextual Attention, CVPR 2018.

available here:

    \code{https://arxiv.org/abs/1801.07892}

Value

a keras layer tensor

Examples

layer_contextual_attention_2d()
layer_contextual_attention_3d()
keras::keras_model_sequential() %>%
    layer_contextual_attention_2d(fusionKernelSize = 2)
keras::keras_model_sequential() %>%
    layer_contextual_attention_3d()

ANTsX/ANTsRNet documentation built on Nov. 21, 2024, 4:07 a.m.