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
538f89c4
Commit
538f89c4
authored
Oct 20, 2017
by
Neal Wu
Committed by
GitHub
Oct 20, 2017
Browse files
Fix wide_deep_test's TEST_CSV path and only test the wide_deep model for the sake of time (#2566)
parent
9683ee99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
official/wide_deep/wide_deep_test.py
official/wide_deep/wide_deep_test.py
+5
-12
No files found.
official/wide_deep/wide_deep_test.py
View file @
538f89c4
...
...
@@ -41,8 +41,7 @@ TEST_INPUT_VALUES = {
'occupation'
:
'abc'
,
}
TEST_TRAINING_CSV
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)),
'wide_deep_test.csv'
)
TEST_CSV
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'wide_deep_test.csv'
)
class
BaseTest
(
tf
.
test
.
TestCase
):
...
...
@@ -80,31 +79,25 @@ class BaseTest(tf.test.TestCase):
# Train for 1 step to initialize model and evaluate initial loss
model
.
train
(
input_fn
=
wide_deep
.
input_fn
(
TEST_
TRAINING_
CSV
,
num_epochs
=
1
,
shuffle
=
True
,
batch_size
=
1
),
TEST_CSV
,
num_epochs
=
1
,
shuffle
=
True
,
batch_size
=
1
),
steps
=
1
)
initial_results
=
model
.
evaluate
(
input_fn
=
wide_deep
.
input_fn
(
TEST_
TRAINING_
CSV
,
num_epochs
=
1
,
shuffle
=
False
,
batch_size
=
1
))
TEST_CSV
,
num_epochs
=
1
,
shuffle
=
False
,
batch_size
=
1
))
# Train for 40 steps at batch size 2 and evaluate final loss
model
.
train
(
input_fn
=
wide_deep
.
input_fn
(
TEST_
TRAINING_
CSV
,
num_epochs
=
None
,
shuffle
=
True
,
batch_size
=
2
),
TEST_CSV
,
num_epochs
=
None
,
shuffle
=
True
,
batch_size
=
2
),
steps
=
40
)
final_results
=
model
.
evaluate
(
input_fn
=
wide_deep
.
input_fn
(
TEST_
TRAINING_
CSV
,
num_epochs
=
1
,
shuffle
=
False
,
batch_size
=
1
))
TEST_CSV
,
num_epochs
=
1
,
shuffle
=
False
,
batch_size
=
1
))
print
(
'%s initial results:'
%
model_type
,
initial_results
)
print
(
'%s final results:'
%
model_type
,
final_results
)
self
.
assertLess
(
final_results
[
'loss'
],
initial_results
[
'loss'
])
def
test_deep_estimator_training
(
self
):
self
.
build_and_test_estimator
(
'deep'
)
def
test_wide_estimator_training
(
self
):
self
.
build_and_test_estimator
(
'wide'
)
def
test_wide_deep_estimator_training
(
self
):
self
.
build_and_test_estimator
(
'wide_deep'
)
...
...
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