Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
f18314d6
Commit
f18314d6
authored
Feb 23, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix validation bug again
parent
741f404d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
tensorpack/callbacks/validation_callback.py
tensorpack/callbacks/validation_callback.py
+2
-1
No files found.
tensorpack/callbacks/validation_callback.py
View file @
f18314d6
...
@@ -48,6 +48,7 @@ class ValidationCallback(PeriodicCallback):
...
@@ -48,6 +48,7 @@ class ValidationCallback(PeriodicCallback):
output_vars
=
self
.
_get_output_vars
()
output_vars
=
self
.
_get_output_vars
()
output_vars
.
append
(
self
.
cost_var
)
output_vars
.
append
(
self
.
cost_var
)
sess
=
tf
.
get_default_session
()
with
tqdm
(
total
=
self
.
ds
.
size
(),
ascii
=
True
)
as
pbar
:
with
tqdm
(
total
=
self
.
ds
.
size
(),
ascii
=
True
)
as
pbar
:
for
dp
in
self
.
ds
.
get_data
():
for
dp
in
self
.
ds
.
get_data
():
feed
=
dict
(
itertools
.
izip
(
self
.
input_vars
,
dp
))
feed
=
dict
(
itertools
.
izip
(
self
.
input_vars
,
dp
))
...
@@ -55,7 +56,7 @@ class ValidationCallback(PeriodicCallback):
...
@@ -55,7 +56,7 @@ class ValidationCallback(PeriodicCallback):
batch_size
=
dp
[
0
]
.
shape
[
0
]
# assume batched input
batch_size
=
dp
[
0
]
.
shape
[
0
]
# assume batched input
cnt
+=
batch_size
cnt
+=
batch_size
outputs
=
se
lf
.
se
ss
.
run
(
output_vars
,
feed_dict
=
feed
)
outputs
=
sess
.
run
(
output_vars
,
feed_dict
=
feed
)
cost
=
outputs
[
-
1
]
cost
=
outputs
[
-
1
]
# each batch might not have the same size in validation
# each batch might not have the same size in validation
cost_sum
+=
cost
*
batch_size
cost_sum
+=
cost
*
batch_size
...
...
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