Commit 9540ca23 authored by Davis King's avatar Davis King

Added operator<< for the DNN solvers.

parent aafde206
......@@ -119,6 +119,12 @@ namespace dlib
deserialize(item.momentum, in);
}
friend std::ostream& operator<< (std::ostream& out, const sgd& item)
{
out << "sgd: weight_decay="<<item.get_weight_decay() << ", momentum="<<item.get_momentum();
return out;
}
private:
template <typename layer_type>
......@@ -294,6 +300,12 @@ namespace dlib
deserialize(item.t, in);
}
friend std::ostream& operator<< (std::ostream& out, const adam& item)
{
out << "adam: weight_decay="<<item.get_weight_decay() << ", momentum1="<<item.get_momentum1() << ", momentum2="<<item.get_momentum2();
return out;
}
private:
template <typename layer_type>
......
......@@ -64,6 +64,11 @@ namespace dlib
provides serialization support
!*/
std::ostream& operator<< (std::ostream& out, const EXAMPLE_SOLVER& item);
/*!
Prints the solver's name and parameters to out.
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
......@@ -121,6 +126,11 @@ namespace dlib
provides serialization support
!*/
std::ostream& operator<< (std::ostream& out, const sgd& item);
/*!
Prints the solver's name and parameters to out.
!*/
// ----------------------------------------------------------------------------------------
class adam
......@@ -181,6 +191,11 @@ namespace dlib
provides serialization support
!*/
std::ostream& operator<< (std::ostream& out, const adam& item);
/*!
Prints the solver's name and parameters to out.
!*/
// ----------------------------------------------------------------------------------------
}
......
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