Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Why is my code giving errors? What did I do wrong? # GRADED _ CELL # UNQ _ C 1 num _ outputs = 3
Why is my code giving errors? What did I do wrong?
# GRADEDCELL
# UNQC
numoutputs
tfrandom.setseed
userNN tfkeras.models.Sequential
### START CODE HERE ###
tfkeras.layers.Dense activation'relu'
tfkeras.layers.Dense activation'relu'
tfkeras.layers.Densenumoutputs, activation'linear'
### END CODE HERE ###
itemNN tfkeras.models.Sequential
### START CODE HERE ###
tfkeras.layers.Dense activation'relu'
tfkeras.layers.Dense activation'relu'
tfkeras.layers.Densenumoutputs, activation'linear'
### END CODE HERE ###
# create the user input and point to the base network
inputuser tfkeras.layers.Inputshapenumuserfeatures
vu userNNinputuser
vu tflinalg.lnormalizevu axis
# create the item input and point to the base network
inputitem tfkeras.layers.Inputshapenumitemfeatures
vm itemNNinputitem
vm tflinalg.lnormalizevm axis
# compute the dot product of the two vectors vu and vm
output tfkeras.layers.Dotaxesvu vm
# specify the inputs and output of the model
model Modelinputuser, inputitem output
model.summary
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started