rasa/core/policies/embedding_policy.py
def _create_tf_nn(self,
                      x_in: tf.Tensor,
                      layer_sizes: List,
                      droprate: float,
                      layer_name_suffix: Text) -> tf.Tensor:
        """Create nn with hidden layers and name suffix."""

        reg = tf.contrib.layers.l2_regularizer(self.C2)
        x = tf.nn.relu(x_in)
        for i, layer_size in enumerate(layer_sizes):
            x = tf.layers.dense(inputs=x,
                                units=layer_size,
                                activation=tf.nn.relu,
                                kernel_regularizer=reg,
                                name='hidden_layer_{}_{}'
                                     ''.format(layer_name_suffix, i),
                                reuse=tf.AUTO_REUSE)
            x = tf.layers.dropout(x, rate=droprate,
                                  training=self._is_training)
        return x
Create nn with hidden layers and name suffix.
Create nn with hidden layers and name suffix.
Create nn with hidden layers and name suffix .
def _create_tf_nn(self,
                      x_in: tf.Tensor,
                      layer_sizes: List,
                      droprate: float,
                      layer_name_suffix: Text) -> tf.Tensor:
        reg = tf.contrib.layers.l2_regularizer(self.C2)
        x = tf.nn.relu(x_in)
        for i, layer_size in enumerate(layer_sizes):
            x = tf.layers.dense(inputs=x,
                                units=layer_size,
                                activation=tf.nn.relu,
                                kernel_regularizer=reg,
                                name='hidden_layer_{}_{}'
                                     ''.format(layer_name_suffix, i),
                                reuse=tf.AUTO_REUSE)
            x = tf.layers.dropout(x, rate=droprate,
                                  training=self._is_training)
        return x
def _create_tf_nn ( self , x_in : tf . Tensor , layer_sizes : List , droprate : float , layer_name_suffix : Text ) -> tf . Tensor : reg = tf . contrib . layers . l2_regularizer ( self . C2 ) x = tf . nn . relu ( x_in ) for i , layer_size in enumerate ( layer_sizes ) : x = tf . layers . dense ( inputs = x , units = layer_size , activation = tf . nn . relu , kernel_regularizer = reg , name = 'hidden_layer_{}_{}' '' . format ( layer_name_suffix , i ) , reuse = tf . AUTO_REUSE ) x = tf . layers . dropout ( x , rate = droprate , training = self . _is_training ) return x
Create nn with hidden layers and name suffix.
Create nn with hidden layers and name suffix .
"""Create nn with hidden layers and name suffix."""
self
x_in
tf.Tensor
layer_sizes
List
droprate
float
layer_name_suffix
Text