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
a9e1c9e4
Commit
a9e1c9e4
authored
Jan 24, 2016
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made add_loss_layer's batch operator() more general.
parent
846a5704
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
core.h
dlib/dnn/core.h
+3
-2
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