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
OpenDAS
dlib
Commits
3d4bd975
Commit
3d4bd975
authored
Sep 19, 2017
by
Davis King
Browse files
Made unit test more robust
parent
bd6f9183
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
dlib/test/ranking.cpp
dlib/test/ranking.cpp
+3
-3
No files found.
dlib/test/ranking.cpp
View file @
3d4bd975
...
@@ -434,7 +434,7 @@ namespace
...
@@ -434,7 +434,7 @@ namespace
x
.
push_back
(
matrix_cast
<
float
>
(
data
.
nonrelevant
[
0
]));
y
.
push_back
(
-
1
);
x
.
push_back
(
matrix_cast
<
float
>
(
data
.
nonrelevant
[
0
]));
y
.
push_back
(
-
1
);
//trainer.be_verbose();
//trainer.be_verbose();
trainer
.
set_learning_rate_schedule
(
logspace
(
-
1
,
-
7
,
2
000
));
trainer
.
set_learning_rate_schedule
(
logspace
(
-
1
,
-
7
,
4
000
));
trainer
.
train
(
x
,
y
);
trainer
.
train
(
x
,
y
);
matrix
<
float
>
params
=
mat
(
net
.
subnet
().
layer_details
().
get_layer_params
());
matrix
<
float
>
params
=
mat
(
net
.
subnet
().
layer_details
().
get_layer_params
());
...
@@ -442,8 +442,8 @@ namespace
...
@@ -442,8 +442,8 @@ namespace
dlog
<<
LINFO
<<
"relevant output score: "
<<
net
(
x
[
0
]);
dlog
<<
LINFO
<<
"relevant output score: "
<<
net
(
x
[
0
]);
dlog
<<
LINFO
<<
"nonrelevant output score: "
<<
net
(
x
[
1
]);
dlog
<<
LINFO
<<
"nonrelevant output score: "
<<
net
(
x
[
1
]);
DLIB_TEST
(
std
::
abs
(
params
(
0
)
-
1
)
<
0.00
0
1
);
DLIB_TEST
(
std
::
abs
(
params
(
0
)
-
1
)
<
0.001
);
DLIB_TEST
(
std
::
abs
(
params
(
1
)
+
1
)
<
0.00
0
1
);
DLIB_TEST
(
std
::
abs
(
params
(
1
)
+
1
)
<
0.001
);
DLIB_TEST
(
std
::
abs
(
net
(
x
[
0
])
-
1
)
<
0.001
);
DLIB_TEST
(
std
::
abs
(
net
(
x
[
0
])
-
1
)
<
0.001
);
DLIB_TEST
(
std
::
abs
(
net
(
x
[
1
])
+
1
)
<
0.001
);
DLIB_TEST
(
std
::
abs
(
net
(
x
[
1
])
+
1
)
<
0.001
);
}
}
...
...
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