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
14334b27
Commit
14334b27
authored
Jan 01, 2014
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A minor change to avoid compiler errors when serializing mlp objects.
parent
339c3040
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
30 deletions
+44
-30
mlp_kernel_1.h
dlib/mlp/mlp_kernel_1.h
+44
-30
No files found.
dlib/mlp/mlp_kernel_1.h
View file @
14334b27
...
@@ -287,6 +287,48 @@ namespace dlib
...
@@ -287,6 +287,48 @@ namespace dlib
friend
void
serialize
(
friend
void
serialize
(
const
mlp_kernel_1
&
item
,
const
mlp_kernel_1
&
item
,
std
::
ostream
&
out
std
::
ostream
&
out
);
friend
void
deserialize
(
mlp_kernel_1
&
item
,
std
::
istream
&
in
);
private
:
long
input_nodes
;
long
first_hidden_nodes
;
long
second_hidden_nodes
;
long
output_nodes
;
double
alpha
;
double
momentum
;
matrix
<
double
>
w1
;
matrix
<
double
>
w2
;
matrix
<
double
>
w3
;
matrix
<
double
>
w1m
;
matrix
<
double
>
w2m
;
matrix
<
double
>
w3m
;
rand
rand_nums
;
// temporary storage
mutable
matrix
<
double
>
e1
,
e2
,
e3
;
mutable
matrix
<
double
>
z
,
tmp1
,
tmp2
,
o
;
};
inline
void
swap
(
mlp_kernel_1
&
a
,
mlp_kernel_1
&
b
)
{
a
.
swap
(
b
);
}
// ----------------------------------------------------------------------------------------
inline
void
serialize
(
const
mlp_kernel_1
&
item
,
std
::
ostream
&
out
)
)
{
{
try
try
...
@@ -312,7 +354,7 @@ namespace dlib
...
@@ -312,7 +354,7 @@ namespace dlib
}
}
}
}
friend
void
deserialize
(
inline
void
deserialize
(
mlp_kernel_1
&
item
,
mlp_kernel_1
&
item
,
std
::
istream
&
in
std
::
istream
&
in
)
)
...
@@ -344,35 +386,7 @@ namespace dlib
...
@@ -344,35 +386,7 @@ namespace dlib
}
}
}
}
private
:
// ----------------------------------------------------------------------------------------
long
input_nodes
;
long
first_hidden_nodes
;
long
second_hidden_nodes
;
long
output_nodes
;
double
alpha
;
double
momentum
;
matrix
<
double
>
w1
;
matrix
<
double
>
w2
;
matrix
<
double
>
w3
;
matrix
<
double
>
w1m
;
matrix
<
double
>
w2m
;
matrix
<
double
>
w3m
;
rand
rand_nums
;
// temporary storage
mutable
matrix
<
double
>
e1
,
e2
,
e3
;
mutable
matrix
<
double
>
z
,
tmp1
,
tmp2
,
o
;
};
inline
void
swap
(
mlp_kernel_1
&
a
,
mlp_kernel_1
&
b
)
{
a
.
swap
(
b
);
}
}
}
...
...
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