Skip to content

Instantly share code, notes, and snippets.

@jcabot
Last active March 23, 2022 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcabot/0674804e0dd8f7126a27aeec9dc4fb5c to your computer and use it in GitHub Desktop.
Save jcabot/0674804e0dd8f7126a27aeec9dc4fb5c to your computer and use it in GitHub Desktop.
Keras model for Xatkit's NLU network
model: tf.keras.models = tf.keras.Sequential([
tf.keras.layers.Embedding(input_dim=configuration.num_words, output_dim=configuration.embedding_dim, input_length=configuration.input_max_num_tokens),
tf.keras.layers.GlobalAveragePooling1D(),
tf.keras.layers.Dense(24, activation='relu'),
tf.keras.layers.Dense(24, activation='relu'),
tf.keras.layers.Dense(len(context.intents), activation='sigmoid')
])
model.compile(loss=tf.keras.losses.SparseCategoricalCrossentropy(), optimizer='adam', metrics=['accuracy'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment