diff --git a/cpp/dA.cpp b/cpp/dA.cpp index e53d3b9..c895340 100644 --- a/cpp/dA.cpp +++ b/cpp/dA.cpp @@ -1,5 +1,6 @@ #include #include +#include "dA.h" using namespace std; @@ -26,26 +27,6 @@ double sigmoid(double x) { } - -class dA { - -public: - int N; - int n_visible; - int n_hidden; - double **W; - double *hbias; - double *vbias; - dA(int, int, int , double**, double*, double*); - ~dA(); - void get_corrupted_input(int*, int*, double); - void get_hidden_values(int*, double*); - void get_reconstructed_input(double*, double*); - void train(int*, double, double); - void reconstruct(int*, double*); -}; - - dA::dA(int size, int n_v, int n_h, double **w, double *hb, double *vb) { N = size; n_visible = n_v; diff --git a/cpp/dA.h b/cpp/dA.h new file mode 100644 index 0000000..3c931e0 --- /dev/null +++ b/cpp/dA.h @@ -0,0 +1,17 @@ +class dA { + +public: + int N; + int n_visible; + int n_hidden; + double **W; + double *hbias; + double *vbias; + dA(int, int, int , double**, double*, double*); + ~dA(); + void get_corrupted_input(int*, int*, double); + void get_hidden_values(int*, double*); + void get_reconstructed_input(double*, double*); + void train(int*, double, double); + void reconstruct(int*, double*); +};