Commit b084076e authored by Davis King's avatar Davis King

Added batch normalization layer skeleton

parent 627db9e1
...@@ -53,6 +53,43 @@ namespace dlib ...@@ -53,6 +53,43 @@ namespace dlib
template <typename SUBNET> template <typename SUBNET>
using con = add_layer<con_, SUBNET>; using con = add_layer<con_, SUBNET>;
// ----------------------------------------------------------------------------------------
class bn_
{
public:
bn_()
{}
template <typename SUBNET>
void setup (const SUBNET& sub)
{
// TODO
}
template <typename SUBNET>
void forward(const SUBNET& sub, resizable_tensor& output)
{
// TODO
}
template <typename SUBNET>
void backward(const tensor& gradient_input, SUBNET& sub, tensor& params_grad)
{
// TODO
}
const tensor& get_layer_params() const { return params; }
tensor& get_layer_params() { return params; }
private:
resizable_tensor params;
};
template <typename SUBNET>
using bn = add_layer<bn_, SUBNET>;
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
class fc_ class fc_
......
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