Created
July 14, 2020 08:34
-
-
Save risenW/d576ed8328e5b2119a825219d2cc95cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Book input network | |
input_books = tf.layers.Input(shape=[1]) | |
embed_books = tf.layers.Embedding(nbook_id + 1,15)(input_books) | |
books_out = tf.layers.Flatten()(embed_books) | |
#user input network | |
input_users = tf.layers.Input(shape=[1]) | |
embed_users = tf.layers.Embedding(nuser_id + 1,15)(input_users) | |
users_out = tf.layers.Flatten()(embed_users) | |
conc_layer = tf.layers.Concatenate()([books_out, users_out]) | |
x = tf.layers.Dense(128, activation='relu')(conc_layer) | |
x_out = x = tf.layers.Dense(1, activation='relu')(x) | |
model = tf.Model([input_books, input_users], x_out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment