layer_spatial_transformer_2d: spatial transformer layer (2-D and 3-D)

View source: R/spatialTransformerNetworkUtilities.R

layer_spatial_transformer_2dR Documentation

spatial transformer layer (2-D and 3-D)

Description

Wraps a custom spatial transformer layer

Usage

layer_spatial_transformer_2d(
  object,
  resampledSize,
  transformType = "affine",
  interpolatorType = "linear",
  name = NULL
)

layer_spatial_transformer_3d(
  object,
  resampledSize,
  transformType = "affine",
  interpolatorType = "linear",
  name = NULL
)

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.

resampledSize

size of the output in voxels

transformType

the spatial transform

interpolatorType

interpolation used for the sampling

name

The name of the layer

Value

a keras layer tensor

Examples

## Not run: 
model <- keras_model_sequential()
input_shape = c(20, 20, 1)
model = model %>%
  layer_conv_2d(filters = 32, kernel_size = c(3,3), activation = 'relu',
                input_shape = input_shape)
model  %>%
  layer_spatial_transformer_2d(resampledSize = c(50, 50))
model  %>%
  layer_spatial_transformer_2d(resampledSize = c(50, 50, 1))

## End(Not run)

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