rasa/core/policies/embedding_policy.py
def _create_tf_dial_embed(
            self,
            embed_utter: tf.Tensor,
            embed_slots: tf.Tensor,
            embed_prev_action: tf.Tensor,
            mask: tf.Tensor,
            embed_for_no_intent: tf.Tensor,
            embed_for_no_action: tf.Tensor,
            embed_for_action_listen: tf.Tensor
    ) -> Tuple[tf.Tensor, Union[tf.Tensor, 'TimeAttentionWrapperState']]:
        """Create rnn for dialogue level embedding."""

        cell_input = tf.concat([embed_utter, embed_slots,
                                embed_prev_action], -1)

        cell = self._create_rnn_cell()

        real_length = tf.cast(tf.reduce_sum(mask, 1), tf.int32)

        if self.is_using_attention():
            cell = self._create_attn_cell(cell, embed_utter,
                                          embed_prev_action,
                                          real_length, embed_for_no_intent,
                                          embed_for_no_action,
                                          embed_for_action_listen)

        return tf.nn.dynamic_rnn(
            cell, cell_input,
            dtype=tf.float32,
            sequence_length=real_length,
            scope='rnn_decoder'
        )
Create rnn for dialogue level embedding.
Create rnn for dialogue level embedding.
Create rnn for dialogue level embedding .
def _create_tf_dial_embed(
            self,
            embed_utter: tf.Tensor,
            embed_slots: tf.Tensor,
            embed_prev_action: tf.Tensor,
            mask: tf.Tensor,
            embed_for_no_intent: tf.Tensor,
            embed_for_no_action: tf.Tensor,
            embed_for_action_listen: tf.Tensor
    ) -> Tuple[tf.Tensor, Union[tf.Tensor, 'TimeAttentionWrapperState']]:
        cell_input = tf.concat([embed_utter, embed_slots,
                                embed_prev_action], -1)
        cell = self._create_rnn_cell()
        real_length = tf.cast(tf.reduce_sum(mask, 1), tf.int32)
        if self.is_using_attention():
            cell = self._create_attn_cell(cell, embed_utter,
                                          embed_prev_action,
                                          real_length, embed_for_no_intent,
                                          embed_for_no_action,
                                          embed_for_action_listen)
        return tf.nn.dynamic_rnn(
            cell, cell_input,
            dtype=tf.float32,
            sequence_length=real_length,
            scope='rnn_decoder'
        )
def _create_tf_dial_embed ( self , embed_utter : tf . Tensor , embed_slots : tf . Tensor , embed_prev_action : tf . Tensor , mask : tf . Tensor , embed_for_no_intent : tf . Tensor , embed_for_no_action : tf . Tensor , embed_for_action_listen : tf . Tensor ) -> Tuple [ tf . Tensor , Union [ tf . Tensor , 'TimeAttentionWrapperState' ] ] : cell_input = tf . concat ( [ embed_utter , embed_slots , embed_prev_action ] , - 1 ) cell = self . _create_rnn_cell ( ) real_length = tf . cast ( tf . reduce_sum ( mask , 1 ) , tf . int32 ) if self . is_using_attention ( ) : cell = self . _create_attn_cell ( cell , embed_utter , embed_prev_action , real_length , embed_for_no_intent , embed_for_no_action , embed_for_action_listen ) return tf . nn . dynamic_rnn ( cell , cell_input , dtype = tf . float32 , sequence_length = real_length , scope = 'rnn_decoder' )
Create rnn for dialogue level embedding.
Create rnn for dialogue level embedding .
"""Create rnn for dialogue level embedding."""
self
embed_utter
tf.Tensor
embed_slots
tf.Tensor
embed_prev_action
tf.Tensor
mask
tf.Tensor
embed_for_no_intent
tf.Tensor
embed_for_no_action
tf.Tensor
embed_for_action_listen
tf.Tensor