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
b6ebdd69
"tests/git@developer.sourcefind.cn:OpenDAS/mmcv.git" did not exist on "1b59409e94c69cfc8a4dd3e0fa55f02d0ae281d3"
Commit
b6ebdd69
authored
Aug 10, 2017
by
cclauss
Committed by
GitHub
Aug 10, 2017
Browse files
from six.moves import range for Python 3
@cshallue
parent
a03b3638
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
skip_thoughts/skip_thoughts/track_perplexity.py
skip_thoughts/skip_thoughts/track_perplexity.py
+3
-1
No files found.
skip_thoughts/skip_thoughts/track_perplexity.py
View file @
b6ebdd69
...
@@ -22,6 +22,8 @@ from __future__ import absolute_import
...
@@ -22,6 +22,8 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
division
from
__future__
import
print_function
from
__future__
import
print_function
from
six.moves
import
range
import
math
import
math
import
os.path
import
os.path
import
time
import
time
...
@@ -75,7 +77,7 @@ def evaluate_model(sess, losses, weights, num_batches, global_step,
...
@@ -75,7 +77,7 @@ def evaluate_model(sess, losses, weights, num_batches, global_step,
start_time
=
time
.
time
()
start_time
=
time
.
time
()
sum_losses
=
0.0
sum_losses
=
0.0
sum_weights
=
0.0
sum_weights
=
0.0
for
i
in
x
range
(
num_batches
):
for
i
in
range
(
num_batches
):
batch_losses
,
batch_weights
=
sess
.
run
([
losses
,
weights
])
batch_losses
,
batch_weights
=
sess
.
run
([
losses
,
weights
])
sum_losses
+=
np
.
sum
(
batch_losses
*
batch_weights
)
sum_losses
+=
np
.
sum
(
batch_losses
*
batch_weights
)
sum_weights
+=
np
.
sum
(
batch_weights
)
sum_weights
+=
np
.
sum
(
batch_weights
)
...
...
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