Skip to content

Instantly share code, notes, and snippets.

@Sirsirious
Created December 14, 2020 17:51
Show Gist options
  • Save Sirsirious/8a443a099f69d304e6e585ae41ce3fdf to your computer and use it in GitHub Desktop.
Save Sirsirious/8a443a099f69d304e6e585ae41ce3fdf to your computer and use it in GitHub Desktop.
# Create a full Keras model using the layer you loaded from trax.
inputs = tf.keras.Input(shape=(None,), dtype='int32')
# Use default Keras syntax to link an input to the layer
hidden = keras_layer(inputs)
# Get the outputs from the trax-loaded layer
outputs = hidden
# Finally, wrap everything with a Keras Model
keras_model = tf.keras.Model(inputs=inputs, outputs=outputs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment