Deep network
network.hpp
Go to the documentation of this file.
1#ifndef NETWORK_HPP
2#define NETWORK_HPP
3
4#include <random>
5#include <list>
6
7#include "layers/layer.hpp"
8#include "dataset.hpp"
9
11
12class Network{
13public:
14 list<Layer::Layer*> layers;
15 size_t n_in;
16 size_t n_out;
21protected:
22 void shuffle(size_t* tab,size_t size);
23 void update_batch(Dataset* dataset,size_t* indices,size_t begin,size_t end,Real eta);
24 void back_propagation(Vector x,Vector y,Real eta);
25public:
26 Network();
28 void push_layer(Layer::Layer& l);
29 void is_done();
31 Real eval(Dataset *dataset);
32 void train(Dataset* dataset,size_t nb_epochs,size_t batch_size,Real eta);
33};
34
35inline void
37 C=C_;
38}
39#endif
Definition: dataset.hpp:9
Definition: layer.hpp:20
Definition: network.hpp:12
Real eval(Dataset *dataset)
Definition: network.cpp:38
void update_batch(Dataset *dataset, size_t *indices, size_t begin, size_t end, Real eta)
Definition: network.cpp:84
void is_done()
Definition: network.cpp:22
Network()
Definition: network.cpp:3
size_t n_out
Definition: network.hpp:16
list< Layer::Layer * > layers
Definition: network.hpp:14
void back_propagation(Vector x, Vector y, Real eta)
Definition: network.cpp:101
void compute_last_delta(Vector y)
Definition: network.cpp:115
void set_cost(CostFunction)
Definition: network.hpp:36
void train(Dataset *dataset, size_t nb_epochs, size_t batch_size, Real eta)
Definition: network.cpp:63
Vector last_delta
Definition: network.hpp:18
size_t n_in
Definition: network.hpp:15
void shuffle(size_t *tab, size_t size)
Definition: network.cpp:52
Vector feed_forward(Vector x_in)
Definition: network.cpp:27
CostFunction C
Definition: network.hpp:19
Vector a
Definition: network.hpp:17
void push_layer(Layer::Layer &l)
Definition: network.cpp:8
CostFunction
Definition: network.hpp:10
@ Quadratic
Definition: network.hpp:10
@ CrossEntropy
Definition: network.hpp:10
double Real
Definition: vector.hpp:9
Real * Vector
Definition: vector.hpp:45