Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
dc45871a
Commit
dc45871a
authored
Aug 21, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made the loss value management a little more conservative.
parent
dc071cea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
trainer.h
dlib/dnn/trainer.h
+8
-4
No files found.
dlib/dnn/trainer.h
View file @
dc45871a
...
...
@@ -701,7 +701,7 @@ namespace dlib
test_steps_without_progress
=
0
;
// Empty out some of the previous loss values so that test_steps_without_progress
// will decrease below test_iter_without_progress_thresh.
for
(
int
cnt
=
0
;
cnt
<
previous_loss_values_dump_amount
&&
test_previous_loss_values
.
size
()
>
0
;
++
cnt
)
for
(
int
cnt
=
0
;
cnt
<
test_
previous_loss_values_dump_amount
&&
test_previous_loss_values
.
size
()
>
0
;
++
cnt
)
test_previous_loss_values
.
pop_front
();
}
}
...
...
@@ -879,7 +879,8 @@ namespace dlib
prob_loss_increasing_thresh
=
prob_loss_increasing_thresh_default_value
;
updated_net_since_last_sync
=
false
;
sync_file_reloaded
=
false
;
previous_loss_values_dump_amount
=
100
;
previous_loss_values_dump_amount
=
400
;
test_previous_loss_values_dump_amount
=
100
;
start
();
}
...
...
@@ -890,7 +891,7 @@ namespace dlib
friend
void
serialize
(
const
dnn_trainer
&
item
,
std
::
ostream
&
out
)
{
item
.
wait_for_thread_to_pause
();
int
version
=
1
0
;
int
version
=
1
1
;
serialize
(
version
,
out
);
size_t
nl
=
dnn_trainer
::
num_layers
;
...
...
@@ -917,6 +918,7 @@ namespace dlib
serialize
(
item
.
test_steps_without_progress
.
load
(),
out
);
serialize
(
item
.
test_previous_loss_values
,
out
);
serialize
(
item
.
previous_loss_values_dump_amount
,
out
);
serialize
(
item
.
test_previous_loss_values_dump_amount
,
out
);
}
friend
void
deserialize
(
dnn_trainer
&
item
,
std
::
istream
&
in
)
...
...
@@ -924,7 +926,7 @@ namespace dlib
item
.
wait_for_thread_to_pause
();
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
0
)
if
(
version
!=
1
1
)
throw
serialization_error
(
"Unexpected version found while deserializing dlib::dnn_trainer."
);
size_t
num_layers
=
0
;
...
...
@@ -961,6 +963,7 @@ namespace dlib
deserialize
(
ltemp
,
in
);
item
.
test_steps_without_progress
=
ltemp
;
deserialize
(
item
.
test_previous_loss_values
,
in
);
deserialize
(
item
.
previous_loss_values_dump_amount
,
in
);
deserialize
(
item
.
test_previous_loss_values_dump_amount
,
in
);
if
(
item
.
devices
.
size
()
>
1
)
{
...
...
@@ -1269,6 +1272,7 @@ namespace dlib
bool
sync_file_reloaded
;
int
previous_loss_values_dump_amount
;
int
test_previous_loss_values_dump_amount
;
};
// ----------------------------------------------------------------------------------------
...
...
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