⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 annlayer.h

📁 一个外国人写的人脸检测程序
💻 H
字号:


#ifndef AnnLayer_h
#define AnnLayer_h


class vec2D;

class AnnLayer
{
        friend class ANNetwork;
public:

        AnnLayer(unsigned int n, unsigned int m);         //n - prev layer neuronsNumber, m - this layer neuronsNumber
        ~AnnLayer();

        enum ACTFUN { LINEAR, SIGMOID, TANH };
                        
        void set_input(const vec2D& x, int fun);                    //set this->inputs[1:size-1] = actfun( x );   inputs[0]-bias 1
        void get_output(float* ovec, int fun) const;                //ovec = actfun(this->outputs)

        void run(int fun, AnnLayer* pnext = 0);                       //outputs = inputs*W'
        //pnext->inputs = actfun( outputs )

private:

        vec2D* m_tW;                    //transposed weights matrix tW   W = tW'
        vec2D* m_inputs;                //inputs [1, x1,x2,x3, ... xN]
        vec2D* m_outputs;               //outputs [y1,y2,y3, ... yN] = inputs*W'

        //unintended functions
        AnnLayer(const AnnLayer& layer);
        const AnnLayer& operator=(const AnnLayer& layer);

};



#endif

/*
    W weights matrix


    N1  N2  N3    neurons

    w00 w01 w02   bias weights
    w10 w11 w12
    w20 w21 w22
    w30 w31 w32
    w40 w41 w42


    tW = W' for mmx multiplications with input vector
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -