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

📄 softperc.h

📁 The program implements three large-margin thresholded ensemble algorithms for ordinal regression. I
💻 H
字号:
/**   softperc.h: a perceptron model with sigmoid outputs   (c) 2006-2007 Hsuan-Tien Lin**/#ifndef __LEMGA_SOFTPERC_H__#define __LEMGA_SOFTPERC_H__#include <vector>#include <perceptron.h>namespace lemga {/** SoftPerc outputs tanh(scale * (w^T x + b)) *  instead of sign(w^T x + b) */class SoftPerc : public Perceptron {private:    REAL scale;public:    explicit SoftPerc (UINT n_in = 0) : Perceptron(n_in), scale(1.0) {}    explicit SoftPerc (std::istream& is) { is >> *this; }    void set_scale(REAL _scale) { assert(scale > 0); scale = _scale; };    virtual const id_t& id () const;    virtual SoftPerc* create () const { return new SoftPerc(); }    virtual SoftPerc* clone () const { return new SoftPerc(*this); }    virtual Output operator() (const Input&) const;    virtual void train();protected:    virtual bool serialize (std::ostream&, ver_list&) const;    virtual bool unserialize (std::istream&, ver_list&, const id_t& = NIL_ID);};} // namespace lemga#ifdef  __SOFTPERC_H__#warning "This header file may conflict with another `softperc.h' file."#endif#define __SOFTPERC_H__#endif

⌨️ 快捷键说明

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