Ejemplo n.º 1
0
    def feature_layer_op(self, inputs: Dict[str, Input]):
        """
        Convert input tensorflow features into numeric
        train features and metadata features by applying respective feature
        transformation functions as specified in the FeatureConfig

        Parameters
        ----------
        inputs : dict
            Dictionary of the inputs to the tensorflow keras model

        Returns
        -------
        train_features : dict
            Dict of feature tensors that are used for training
        metadata_features : dict
            Dictionary of feature tensors that can be used for
            computing custom metrics and losses
        """
        train_features, metadata_features = define_feature_layer(
            feature_config=self.feature_config,
            tfrecord_type=self.tfrecord_type,
            feature_layer_map=self.feature_layer_map,
            file_io=self.file_io,
        )(inputs)

        return train_features, metadata_features
Ejemplo n.º 2
0
    def feature_layer_op(self, inputs: Dict[str, Input]):
        """
        Apply feature layer functions on each of the tf.keras.Input

        Args:
            inputs: dictionary of keras input symbolic tensors

        Returns:
            train_features: dictionary of feature tensors that can be used for training
            metadata_features: dictionary of feature tensors that can be used as additional metadata
        """
        train_features, metadata_features = define_feature_layer(
            feature_config=self.feature_config,
            tfrecord_type=self.tfrecord_type,
            feature_layer_map=self.feature_layer_map,
            file_io=self.file_io,
        )(inputs)

        return train_features, metadata_features