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
14334b27
Commit
14334b27
authored
Jan 01, 2014
by
Davis King
Browse files
A minor change to avoid compiler errors when serializing mlp objects.
parent
339c3040
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
52 deletions
+66
-52
dlib/mlp/mlp_kernel_1.h
dlib/mlp/mlp_kernel_1.h
+66
-52
No files found.
dlib/mlp/mlp_kernel_1.h
View file @
14334b27
...
...
@@ -287,6 +287,48 @@ namespace dlib
friend
void
serialize
(
const
mlp_kernel_1
&
item
,
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
...
...
@@ -312,7 +354,7 @@ namespace dlib
}
}
friend
void
deserialize
(
inline
void
deserialize
(
mlp_kernel_1
&
item
,
std
::
istream
&
in
)
...
...
@@ -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