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
a9e1c9e4
Commit
a9e1c9e4
authored
Jan 23, 2016
by
Davis King
Browse files
Made add_loss_layer's batch operator() more general.
parent
846a5704
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
dlib/dnn/core.h
dlib/dnn/core.h
+3
-2
dlib/dnn/core_abstract.h
dlib/dnn/core_abstract.h
+5
-1
No files found.
dlib/dnn/core.h
View file @
a9e1c9e4
...
...
@@ -1923,12 +1923,13 @@ namespace dlib
return
temp_label
;
}
template
<
typename
iterable_type
>
std
::
vector
<
label_type
>
operator
()
(
const
std
::
vector
<
input
_type
>
&
data
,
const
iterable
_type
&
data
,
size_t
batch_size
=
128
)
{
std
::
vector
<
label_type
>
results
(
data
.
size
(
));
std
::
vector
<
label_type
>
results
(
std
::
distance
(
data
.
begin
(),
data
.
end
()
));
auto
o
=
results
.
begin
();
for
(
auto
i
=
data
.
begin
();
i
<
data
.
end
();
i
+=
batch_size
,
o
+=
batch_size
)
{
...
...
dlib/dnn/core_abstract.h
View file @
a9e1c9e4
...
...
@@ -688,13 +688,17 @@ namespace dlib
label_type.
!*/
template
<
typename
iterable_type
>
std
::
vector
<
label_type
>
operator
()
(
const
std
::
vector
<
input
_type
>
&
data
,
const
iterable
_type
&
data
,
size_t
batch_size
=
128
);
/*!
requires
- batch_size > 0
- data must have a .begin() and .end() that supply iterators over a
sequence of input_type elements. E.g. data could have a type of
std::vector<input_type>
ensures
- runs all the objects in data through the network and returns their
predicted labels. This means this function returns a vector V such that:
...
...
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