Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
3d2a7e7f
"doc/vscode:/vscode.git/clone" did not exist on "050b745a6e2d94423bf1138f585a94b661210bff"
Commit
3d2a7e7f
authored
Jun 03, 2019
by
guptapriya
Committed by
guptapriya
Jun 03, 2019
Browse files
Address code review comments
parent
d0186041
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
official/recommendation/ncf_keras_main.py
official/recommendation/ncf_keras_main.py
+2
-4
No files found.
official/recommendation/ncf_keras_main.py
View file @
3d2a7e7f
...
...
@@ -62,14 +62,12 @@ class MetricLayer(tf.keras.layers.Layer):
def
__init__
(
self
,
params
):
super
(
MetricLayer
,
self
).
__init__
()
self
.
params
=
params
def
build
(
self
,
input_shape
):
self
.
metric
=
tf
.
keras
.
metrics
.
Mean
(
name
=
rconst
.
HR_METRIC_NAME
)
def
call
(
self
,
inputs
):
logits
,
dup_mask
=
inputs
in_top_k
,
metric_weights
=
metric_fn
(
logits
,
dup_mask
,
self
.
params
)
self
.
add_metric
(
self
.
metric
(
in_top_k
,
metric_weights
))
self
.
add_metric
(
self
.
metric
(
in_top_k
,
sample_weight
=
metric_weights
))
return
logits
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment