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
bcef0f86
Commit
bcef0f86
authored
Sep 25, 2015
by
Davis King
Browse files
Yet more cleanup
parent
a746eb1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
dlib/dnn/loss.h
dlib/dnn/loss.h
+4
-1
No files found.
dlib/dnn/loss.h
View file @
bcef0f86
...
...
@@ -66,6 +66,7 @@ namespace dlib
- SUB_NET implements the SUB_NET interface defined at the top of layers_abstract.h.
- input_tensor was given as input to the network sub and the outputs are now
visible in sub.get_output(), sub.sub_net().get_output(), etc.
- input_tensor.num_samples() > 0
- input_tensor.num_samples() must be a multiple of sample_expansion_factor.
- input_tensor.num_samples() == sub.get_output().num_samples() == grad.num_samples()
- truth == an iterator pointing to the beginning of a range of
...
...
@@ -83,7 +84,8 @@ namespace dlib
const
tensor
&
output_tensor
=
sub
.
get_output
();
tensor
&
grad
=
sub
.
get_gradient_input
();
// TODO, throw an exception instead of asserting, probably...
DLIB_CASSERT
(
input_tensor
.
num_samples
()
!=
0
,
""
);
DLIB_CASSERT
(
input_tensor
.
num_samples
()
%
sample_expansion_factor
==
0
,
""
);
DLIB_CASSERT
(
input_tensor
.
num_samples
()
==
grad
.
num_samples
(),
""
);
DLIB_CASSERT
(
input_tensor
.
num_samples
()
==
output_tensor
.
num_samples
(),
""
);
DLIB_CASSERT
(
output_tensor
.
nr
()
==
1
&&
...
...
@@ -98,6 +100,7 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
output_tensor
.
num_samples
();
++
i
)
{
const
float
y
=
*
truth
++
;
DLIB_CASSERT
(
y
==
+
1
||
y
==
-
1
,
"y: "
<<
y
);
const
float
temp
=
1
-
y
*
out_data
[
i
];
if
(
temp
>
0
)
{
...
...
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