Skip to content

unienv_interface.transformations.crop

CropTransformation

CropTransformation(crop_low: Union[int, float, BArrayType], crop_high: Union[int, float, BArrayType])

Bases: DataTransformation

Initialize Crop Transformation. Args: crop_low: Lower bound for cropping the data. crop_high: Upper bound for cropping the data.

has_inverse class-attribute instance-attribute

has_inverse = True

crop_low instance-attribute

crop_low = crop_low

crop_high instance-attribute

crop_high = crop_high

validate_source_space

validate_source_space(source_space: Space[Any, BDeviceType, BDtypeType, BRNGType]) -> None

get_crop_range

get_crop_range(source_space: BoxSpace[Any, BDeviceType, BDtypeType, BRNGType]) -> Tuple[BArrayType, BArrayType]

get_target_space_from_source

get_target_space_from_source(source_space)

transform

transform(source_space, data)

direction_inverse

direction_inverse(source_space=None)

serialize

serialize(source_space: Optional[Space[Any, BDeviceType, BDtypeType, BRNGType]] = None) -> Dict[str, Any]

deserialize_from classmethod

deserialize_from(json_data: Dict[str, Any], source_space: Optional[Space[Any, BDeviceType, BDtypeType, BRNGType]] = None) -> CropTransformation

close

close()