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
20b9e4c5
Commit
20b9e4c5
authored
Sep 24, 2015
by
Davis King
Browse files
Fixed bug in minibatch creation.
parent
11f47957
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dlib/dnn/core.h
dlib/dnn/core.h
+4
-2
No files found.
dlib/dnn/core.h
View file @
20b9e4c5
...
...
@@ -1346,6 +1346,8 @@ namespace dlib
- data.size() == labels.size()
!*/
{
DLIB_CASSERT
(
data
.
size
()
==
labels
.
size
(),
""
);
const
int
batch_size
=
11
;
for
(
int
iter
=
0
;
iter
<
300
;
++
iter
)
{
...
...
@@ -1354,7 +1356,7 @@ namespace dlib
// TODO, move the contents of update() here and do the alternating tensor
// loading thing to hide GPU transfer latency.
std
::
cout
<<
"loss: "
<<
net
.
update
(
data
.
begin
()
+
i
,
data
.
begin
()
+
std
::
min
(
i
+
batch_size
,
i
+
data
.
size
()
-
1
),
data
.
begin
()
+
std
::
min
(
i
+
batch_size
,
data
.
size
()),
labels
.
begin
()
+
i
,
solvers
)
<<
std
::
endl
;
}
...
...
@@ -1382,7 +1384,7 @@ namespace dlib
// TODO, move the contents of update() here and do the alternating tensor
// loading thing to hide GPU transfer latency.
std
::
cout
<<
"loss: "
<<
net
.
update
(
data
.
begin
()
+
i
,
data
.
begin
()
+
std
::
min
(
i
+
batch_size
,
i
+
data
.
size
()
-
1
),
data
.
begin
()
+
std
::
min
(
i
+
batch_size
,
data
.
size
()),
solvers
)
<<
std
::
endl
;
}
}
...
...
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