human
What is a code to 3 given the following:
3. Implementing a model
The NCFModel we implemented is very similar to the conventional one, and the main difference lies in the embedding layer. We specify the variable of embedding layer by tfra.embedding_variable.EmbeddingVariable."
Please write code following the instructions in jupyter notebook style.
assistant
#Here is code to 3.

class NCFModel(tf.keras.Model):

    def __init__(self):
        super(NCFModel, self).__init__()
        self.embedding_size = 32
        self.d0 = Dense(
            256,
            activation='relu',
            kernel_initializer=tf.keras.initializers.RandomNormal(0.0, 0.1),
            bias_initializer=tf.keras.initializers.RandomNormal(0.0, 0.1))
        self.d1 = Dense(
            64,
            activation='relu',
            kernel_initializer=tf.keras.initializers.RandomNormal(0.0, 0.1),
            bias_initializer=tf.keras.initializers.RandomNormal(0.0, 0.1))
        self.d2 = Dense(
            1,
            kernel_initializer=tf.keras.initializers.RandomNormal(0.0, 0.1),
            bias_initializer=tf.keras.initializers.RandomNormal(0.0, 0.1))
        self.user_embeddings = tfra.embedding_variable.EmbeddingVariable(
            name="user_dynamic_embeddings",
            embedding_dim=self.embedding_size,
            ktype=tf.int64,
            initializer=tf.keras.initializers.RandomNormal(-1, 1))
        self.movie_embeddings = tfra.embedding_variable.EmbeddingVariable(
            name="moive_dynamic_embeddings",
            embedding_dim=self.embedding_size,
            ktype=tf.int64,
            initializer=tf.keras.initializers.RandomNormal(-1, 1))
        self.loss = tf.keras.losses.MeanSquaredError()

    def call(self, batch):
        movie_id = batch["movie_id"]
        user_id = batch["user_id"]
        rating = batch["user_rating"]

        user_id_val, user_id_idx = tf.unique(user_id)
        user_id_weights = tf.nn.embedding_lookup(
            params=self.user_embeddings,
            ids=user_id_val,
            name="user-id-weights")
        user_id_weights = tf.gather(user_id_weights, user_id_idx)

        movie_id_val, movie_id_idx = tf.unique(movie_id)
        movie_id_weights = tf.nn.embedding_lookup(
            params=self.movie_embeddings,
            ids=movie_id_val,
            name="movie-id-weights")
        movie_id_weights = tf.gather(movie_id_weights,...