Skip to content

PassthroughFeature

PassthroughFeature for including features in output without processing.

Constructor

__init__(self, name: str, feature_type: kdp.features.FeatureType = <FeatureType.PASSTHROUGH: 11>, dtype: tensorflow.python.framework.dtypes.DType = tf.float32, **kwargs) -> None

Initializes a PassthroughFeature instance.

Parameters- name (str): The name of the feature.

feature_type (FeatureType): The type of the feature.
dtype (tf.DType): The data type of the feature.
**kwargs: Additional keyword arguments for the feature.

add_preprocessor

add_preprocessor(self, preprocessor: kdp.layers_factory.PreprocessorLayerFactory | typing.Any) -> None

Adds a preprocessor to the feature.

Parameters- preprocessor (Union[PreprocessorLayerFactory, Any]): The preprocessor to add.


from_string

from_string(type_str: str) -> 'FeatureType'

Converts a string to a FeatureType.

Parameters- type_str (str): The string representation of the feature type.


update_kwargs

update_kwargs(self, **kwargs) -> None

Updates the kwargs with new or modified parameters.

Parameters

**kwargs: The new or modified parameters.