Skip to contents

Calls torchvision::transform_grayscale, see there for more information on the parameters. The preprocessing is applied to each element of a batch individually.

Being a trafo_ operator, its stages parameter starts out as "both", so the transformation is applied both while training and when predicting. Set stages = "train" to restrict it to training. See PipeOpTaskPreprocTorch for the stages parameter and this naming convention.

Format

R6Class inheriting from PipeOpTaskPreprocTorch.

Construction

po("trafo_grayscale")

Parameters

IdTypeDefaultLevelsRange
num_output_channelsinteger-\([1, 3]\)
stagescharacter-train, predict, both-
affect_columnsuntypedselector_all()-