Commit 14334b27 authored by Davis King's avatar Davis King

A minor change to avoid compiler errors when serializing mlp objects.

parent 339c3040
......@@ -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); }
// ----------------------------------------------------------------------------------------
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment