rasa/core/policies/embedding_policy.py
def _create_tf_session_data(self,
                                domain: 'Domain',
                                data_X: np.ndarray,
                                data_Y: Optional[np.ndarray] = None
                                ) -> SessionData:
        """Combine all tf session related data into a named tuple"""

        X, slots, previous_actions = \
            self._create_X_slots_previous_actions(data_X)

        if data_Y is not None:
            # training time
            actions_for_Y = self._actions_for_Y(data_Y)
            Y = self._action_features_for_Y(actions_for_Y)
        else:
            # prediction time
            actions_for_Y = None
            Y = None

        x_for_no_intent = self._create_zero_vector(X)
        y_for_no_action = self._create_zero_vector(previous_actions)
        y_for_action_listen = self._create_y_for_action_listen(domain)

        # is needed to calculate train accuracy
        all_Y_d = self._create_all_Y_d(X.shape[1])

        return SessionData(
            X=X, Y=Y, slots=slots,
            previous_actions=previous_actions,
            actions_for_Y=actions_for_Y,
            x_for_no_intent=x_for_no_intent,
            y_for_no_action=y_for_no_action,
            y_for_action_listen=y_for_action_listen,
            all_Y_d=all_Y_d
        )

        # tf helpers:
Combine all tf session related data into a named tuple
Combine all tf session related data into a named tuple
Combine all tf session related data into a named tuple
def _create_tf_session_data(self,
                                domain: 'Domain',
                                data_X: np.ndarray,
                                data_Y: Optional[np.ndarray] = None
                                ) -> SessionData:
        X, slots, previous_actions = \
            self._create_X_slots_previous_actions(data_X)
        if data_Y is not None:
            actions_for_Y = self._actions_for_Y(data_Y)
            Y = self._action_features_for_Y(actions_for_Y)
        else:
            actions_for_Y = None
            Y = None
        x_for_no_intent = self._create_zero_vector(X)
        y_for_no_action = self._create_zero_vector(previous_actions)
        y_for_action_listen = self._create_y_for_action_listen(domain)
        all_Y_d = self._create_all_Y_d(X.shape[1])
        return SessionData(
            X=X, Y=Y, slots=slots,
            previous_actions=previous_actions,
            actions_for_Y=actions_for_Y,
            x_for_no_intent=x_for_no_intent,
            y_for_no_action=y_for_no_action,
            y_for_action_listen=y_for_action_listen,
            all_Y_d=all_Y_d
        )
def _create_tf_session_data ( self , domain : 'Domain' , data_X : np . ndarray , data_Y : Optional [ np . ndarray ] = None ) -> SessionData : X , slots , previous_actions = self . _create_X_slots_previous_actions ( data_X ) if data_Y is not None : actions_for_Y = self . _actions_for_Y ( data_Y ) Y = self . _action_features_for_Y ( actions_for_Y ) else : actions_for_Y = None Y = None x_for_no_intent = self . _create_zero_vector ( X ) y_for_no_action = self . _create_zero_vector ( previous_actions ) y_for_action_listen = self . _create_y_for_action_listen ( domain ) all_Y_d = self . _create_all_Y_d ( X . shape [ 1 ] ) return SessionData ( X = X , Y = Y , slots = slots , previous_actions = previous_actions , actions_for_Y = actions_for_Y , x_for_no_intent = x_for_no_intent , y_for_no_action = y_for_no_action , y_for_action_listen = y_for_action_listen , all_Y_d = all_Y_d )
Combine all tf session related data into a named tuple
Combine all tf session related data into a named tuple
"""Combine all tf session related data into a named tuple""" # training time # prediction time # is needed to calculate train accuracy # tf helpers:
self
domain
'Domain'
data_X
np.ndarray
data_Y
Optional[np.ndarray]