Custom scale layer

Value

A keras layer

Arguments

axis

integer specifying which axis to normalize.

momentum

momentum value used for computation of the exponential average of the mean and standard deviation.

input_shape

Dimensionality of the input (integer) not including the samples axis.

Details

$initialize instantiates a new class.

$call main body.

$compute_output_shape computes the output shape.

Author

Tustison NJ

Examples

library(keras) inputImageSize = c( 256L, 256L, 1L ) inputs <- keras::layer_input( shape = inputImageSize )
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not exist
outputs <- inputs %>% layer_zero_padding_2d( padding = c( 3L, 3L ) )
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not exist
layer_scale = ANTsRNet:::layer_scale outputs = outputs %>% layer_scale(axis = -1L)
#> Error in py_discover_config(required_module, use_environment): Python specified in RETICULATE_PYTHON (/Users/ntustison/anaconda3/envs/antsx/bin/python3) does not exist
lay = ScaleLayer$new() if (FALSE) { lay$build(input_shape = inputImageSize) }