亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ebm.h

?? Gaussian Mixture Algorithm
?? H
?? 第 1 頁 / 共 2 頁
字號:
/*************************************************************************** *   Copyright (C) 2008 by Yann LeCun   * *   yann@cs.nyu.edu   * * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: *     * Redistributions of source code must retain the above copyright *       notice, this list of conditions and the following disclaimer. *     * Redistributions in binary form must reproduce the above copyright *       notice, this list of conditions and the following disclaimer in the *       documentation and/or other materials provided with the distribution. *     * Redistribution under a license not approved by the Open Source *       Initiative (http://www.opensource.org) must display the *       following acknowledgement in all advertising material: *        This product includes software developed at the Courant *        Institute of Mathematical Sciences (http://cims.nyu.edu). *     * The names of the authors may not be used to endorse or promote products *       derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL ThE AUTHORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/#ifndef EBM_H_#define EBM_H_#include "Idx.h"#include "Blas.h"namespace ebl {//! see numerics.h for descriptionextern bool drand_ini;void err_not_implemented();class infer_param {};//! class that contains all the parameters//! for a stochastic gradient descent update,//! including step sizes, regularizer coefficients...class gd_param: public infer_param {public:	//! global step size	double eta;	//! time at which to start using decay values	int decay_time;	//! L2 regularizer coefficient	double decay_l2;	//! L1 regularizer coefficient	double decay_l1;	//! stopping criterion threshold	double n;	//! momentum term	double inertia;	//! annealing coefficient for the learning rate	double anneal_value;	//! number of iteration beetween two annealings	double anneal_time;	//! threshold on square norm of gradient for stopping	double gradient_threshold;	//! for debugging purpose	int niter_done;	gd_param(double leta, double ln, double l1, double l2, int dtime,			double iner, double a_v, double a_t, double g_t);};//////////////////////////////////////////////////////////////////! abstract class for randomization parametersclass forget_param {};class forget_param_linear: public forget_param {public:	//! each random value will be drawn uniformly	//! from [-value/(fanin**exponent), +value/(fanin**exponent)]	double value;	double exponent;	//! constructor.	//! each random value will be drawn uniformly	//! from [-v/(fanin**exponent), +v/(fanin**exponent)]	forget_param_linear(double v, double e);};//////////////////////////////////////////////////////////////////! abstract class that stores a state.//! it must support the following methods//! clear (clear values), clear_dx (clear gradients),//! clear_ddx (clear hessian), and update_gd(arg) (update//! with gradient descent.class state {public:	virtual void clear();	virtual void clear_dx();	virtual void clear_ddx();	virtual void update_gd(gd_param &arg);	state();	virtual ~state();};class parameter;//! class that stores a vector/tensor stateclass state_idx: public state {public:	//! state itself	Idx<double> x;	//! gradient of loss with respect to state	Idx<double> dx;	//! diag hessian of loss with respect to state	Idx<double> ddx;	//! Constructs a state_idx of order 0	state_idx();	//! Constructs a state_idx of order 1	state_idx(intg s0);	//! Constructs a state_idx of order 2	state_idx(intg s0, intg s1);	//! Constructs a state_idx of order 3	state_idx(intg s0, intg s1, intg s2);	//! Constructor. A state_idx can have up to 8 dimensions.	state_idx(intg s0, intg s1, intg s2, intg s3, intg s4 = -1, intg s5 = -1,			intg s6 = -1, intg s7 = -1);	//! this appends the state_idx into the same Srg as the	//! state_idx passed as argument. This is useful for	//! allocating multiple state_idx inside a parameter.	//! This replaces the Lush function alloc_state_idx.	state_idx(parameter *st);	state_idx(parameter *st, intg s0);	state_idx(parameter *st, intg s0, intg s1);	state_idx(parameter *st, intg s0, intg s1, intg s2);	state_idx(parameter *st, intg s0, intg s1, intg s2, intg s3, intg s4 = -1,			intg s5 = -1, intg s6 = -1, intg s7 = -1);	virtual ~state_idx();	//! clear x	void clear();	//! clear gradients dx	void clear_dx();	//! clear diag hessians ddx	void clear_ddx();	//! return number of elements	intg nelements();	//! return footprint in storages	intg footprint();	//! same as footprint	intg size();	//! update with gradient descent	virtual void update_gd(gd_param &arg);	//! resize. The order cannot be changed with this.	virtual void resize(intg s0 = -1, intg s1 = -1, intg s2 = -1, intg s3 = -1,			intg s4 = -1, intg s5 = -1, intg s6 = -1, intg s7 = -1);	virtual void resizeAs(state_idx &s);	virtual void resize(const intg* dimsBegin, const intg* dimsEnd);	//! make a new copy of self	virtual state_idx make_copy();};//////////////////////////////////////////////////////////////////! parameter: the main class for a trainable//! parameter vector.class parameter: public state_idx {public:	Idx<double> gradient;	Idx<double> deltax;	Idx<double> epsilons;	Idx<double> ddeltax;	//! constructor	parameter(intg initial_size = 100);	virtual ~parameter();	virtual void resize(intg s0);	void update_gd(gd_param &arg);	virtual void update(gd_param &arg);	void clear_deltax();	void update_deltax(double knew, double kold);	void clear_ddeltax();	void update_ddeltax(double knew, double kold);	void set_epsilons(double m);	void compute_epsilons(double mu);	bool load(const char *s);	void save(const char *s);};////////////////////////////////////////////////////////////////// templates for generic modules//! abstract class for a module with one input and one output.template<class Tin, class Tout> class module_1_1 {public:	virtual ~module_1_1() {	}	virtual void fprop(Tin *in, Tout *out);	virtual void bprop(Tin *in, Tout *out);	virtual void bbprop(Tin *in, Tout *out);	virtual void forget(forget_param_linear& fp);	virtual void normalize();};//////////////////////////////////////////////////////////////////! abstract class for a module with two inputs and one output.template<class Tin1, class Tin2, class Tout> class module_2_1 {public:	virtual ~module_2_1() {	}	;	virtual void fprop(Tin1 *in1, Tin2 *in2, Tout *out);	virtual void bprop(Tin1 *in1, Tin2 *in2, Tout *out);	virtual void bbprop(Tin1 *in1, Tin2 *in2, Tout *out);	virtual void forget(forget_param &fp);	virtual void normalize();};//////////////////////////////////////////////////////////////////! abstract class for a module with one inputs and one energy output.template<class Tin> class ebm_1 {public:	virtual ~ebm_1() {	}	;	virtual void fprop(Tin *in, state_idx *energy);	virtual void bprop(Tin *in, state_idx *energy);	virtual void bbprop(Tin *in, state_idx *energy);	virtual void forget(forget_param &fp);	virtual void normalize();};//////////////////////////////////////////////////////////////////! abstract class for a module with two inputs and one energy output.template<class Tin1, class Tin2> class ebm_2 {public:	virtual ~ebm_2() {	}	;	//! fprop: compute output from input	virtual void fprop(Tin1 *i1, Tin2 *i2, state_idx *energy);	//! bprop: compute gradient wrt inputs, given gradient wrt output	virtual void bprop(Tin1 *i1, Tin2 *i2, state_idx *energy);	//! bprop: compute diaghession wrt inputs, given diaghessian wrt output	virtual void bbprop(Tin1 *i1, Tin2 *i2, state_idx *energy);	virtual void bprop1_copy(Tin1 *i1, Tin2 *i2, state_idx *energy);	virtual void bprop2_copy(Tin1 *i1, Tin2 *i2, state_idx *energy);	virtual void bbprop1_copy(Tin1 *i1, Tin2 *i2, state_idx *energy);	virtual void bbprop2_copy(Tin1 *i1, Tin2 *i2, state_idx *energy);	virtual void forget(forget_param &fp);	virtual void normalize();	//! compute value of in1 that minimizes the energy, given in2	virtual double infer1(Tin1 *i1, Tin2 *i2, state_idx *energy,			infer_param *ip) {		return 0;	}	//! compute value of in2 that minimizes the energy, given in1	virtual double infer2(Tin1 *i1, Tin2 *i2, state_idx *energy,			infer_param *ip) {		return 0;	}};////////////////////////////////////////////////////////////////// generic architecturestemplate<class Tin, class Thid, class Tout> class layers_2: public module_1_1<		Tin, Tout> {public:	module_1_1<Tin, Thid> *layer1;	Thid *hidden;	module_1_1<Thid, Tout> *layer2;	layers_2(module_1_1<Tin, Thid> *l1, Thid *h, module_1_1<Thid, Tout> *l2);	virtual ~layers_2();	void fprop(Tin *in, Tout *out);	void bprop(Tin *in, Tout *out);	void bbprop(Tin *in, Tout *out);	void forget(forget_param &fp);	void normalize();};template<class T> class layers_n: public module_1_1<T, T> {public:	std::vector< module_1_1<T, T>* > *modules;	std::vector< T* > *hiddens;	layers_n();	layers_n(bool oc);	virtual ~layers_n();	void addModule(module_1_1 <T, T>* module, T* hidden);	void fprop(T *in, T *out);	void bprop(T *in, T *out);	void bbprop(T *in, T *out);	void forget(forget_param_linear &fp);	void normalize();private:	bool own_contents;};////////////////////////////////////////////////////////////////////! standard 1 input EBM with one module-1-1, and one ebm-1 on top.//! fc stands for "function+cost".template<class Tin, class Thid> class fc_ebm1: public ebm_1<Tin> {public:	module_1_1<Tin, Thid> *fmod;	Thid *fout;	ebm_1<Thid> *fcost;	fc_ebm1(module_1_1<Tin, Thid> *fm, Thid *fo, ebm_1<Thid> *fc);	virtual ~fc_ebm1();	void fprop(Tin *in, state_idx *energy);	void bprop(Tin *in, state_idx *energy);	void bbprop(Tin *in, state_idx *energy);	void forget(forget_param &fp);};//////////////////////////////////////////////////////////////////! standard 2 input EBM with one module-1-1, and one ebm-2 on top.//! fc stands for "function+cost".template<class Tin1, class Tin2, class Thid> class fc_ebm2: public ebm_2<Tin1,		Tin2> {public:	module_1_1<Tin1, Thid> *fmod;	Thid *fout;	ebm_2<Thid, Tin2> *fcost;	fc_ebm2(module_1_1<Tin1, Thid> *fm, Thid *fo, ebm_2<Thid, Tin2> *fc);	virtual ~fc_ebm2();	void fprop(Tin1 *in1, Tin2 *in2, state_idx *energy);	void bprop(Tin1 *in1, Tin2 *in2, state_idx *energy);	void bbprop(Tin1 *in1, Tin2 *in2, state_idx *energy);	void forget(forget_param &fp);};////////////////////////////////////////////////////////////////// linear module// It's different from f_layer in that it is// not spatially replicable and does not operate// on 3D state_idx.class linear_module: public module_1_1<state_idx, state_idx> {public:	state_idx *w;	virtual ~linear_module();	linear_module(parameter *p, intg in0, intg out0);	void fprop(state_idx *in, state_idx *out);	void bprop(state_idx *in, state_idx *out);	void bbprop(state_idx *in, state_idx *out);	void forget(forget_param_linear &fp);	void normalize();};//////////////////////////////////////////////////////////////////! a slab of standard Lush sigmoidsclass stdsigmoid_module: public module_1_1<state_idx, state_idx> {public:	//! empty constructor	stdsigmoid_module();	virtual ~stdsigmoid_module();	//! fprop from in to out	virtual void fprop(state_idx *in, state_idx *out);	//! bprop	virtual void bprop(state_idx *in, state_idx *out);	//! bbprop	virtual void bbprop(state_idx *in, state_idx *out);};//////////////////////////////////////////////////////////////////! a slab of tanhclass tanh_module: public module_1_1<state_idx, state_idx> {public:	//! fprop from in to out	void fprop(state_idx *in, state_idx *out);	//! bprop	void bprop(state_idx *in, state_idx *out);	//! bbprop	void bbprop(state_idx *in, state_idx *out);	void forget(forget_param_linear &fp);	void normalize();};//////////////////////////////////////////////////////////////////! constant addclass addc_module: public module_1_1<state_idx, state_idx> {public:	// coefficients	state_idx* bias;	addc_module(parameter *p, intg size);	~addc_module();	//! fprop from in to out	void fprop(state_idx *in, state_idx *out);	//! bprop	void bprop(state_idx *in, state_idx *out);	//! bbprop	void bbprop(state_idx *in, state_idx *out);	void forget(forget_param_linear &fp);	void normalize();};//////////////////////////////////////////////////////////////////! a simple fully-connected neural net layer: linear + tanh non-linearity.//! Unlike the f-layer class, this one is not spatially replicable.class nn_layer_full: public module_1_1<state_idx, state_idx> {public:	//! linear module for weight matrix	linear_module *linear;	//! bias vector	state_idx *bias;	//! weighted sum	state_idx *sum;	//! the non-linear function	tanh_module *sigmoid;	//! constructor. Arguments are a pointer to a parameter	//! in which the trainable weights will be appended,	//! the number of inputs, and the number of outputs.	nn_layer_full(parameter *p, intg ninputs, intg noutputs);	virtual ~nn_layer_full();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩一区二区三区免费看| 国产成人综合视频| 欧美日本国产一区| 亚洲国产一区二区三区青草影视| 91丝袜美腿高跟国产极品老师 | 91精品综合久久久久久| 亚洲电影第三页| 日韩一级在线观看| 国产精品一区二区久激情瑜伽| 国产精品麻豆视频| 欧美性猛交xxxxxx富婆| 欧美视频中文字幕| 欧美日韩在线精品一区二区三区激情| 一卡二卡三卡日韩欧美| 欧美亚洲一区二区在线| 天天综合色天天| 欧美tickling挠脚心丨vk| 国产成人鲁色资源国产91色综| 国产精品嫩草99a| 欧美午夜精品免费| 久久激情五月激情| 国产精品视频九色porn| 欧美性受xxxx| 国产91丝袜在线播放| 一区二区视频在线看| 91精品国产综合久久久久久| 国产精品一区二区不卡| 亚洲午夜一区二区| 国产视频亚洲色图| 欧美乱妇15p| 成人av中文字幕| 热久久免费视频| 日韩美女精品在线| 26uuuu精品一区二区| 欧美性大战久久久久久久蜜臀| 狠狠狠色丁香婷婷综合激情| 亚洲综合激情另类小说区| 精品国产乱码久久久久久闺蜜| 色综合天天性综合| 久久爱www久久做| 亚洲国产精品久久久男人的天堂| 久久精品一二三| 3atv在线一区二区三区| 97精品视频在线观看自产线路二 | 一区二区久久久| 亚洲精品一区二区三区影院| 91国产视频在线观看| 成人免费毛片a| 精品亚洲成av人在线观看| 亚洲成人一区在线| 亚洲女爱视频在线| 久久久精品免费免费| 欧美精品99久久久**| 色呦呦一区二区三区| 丁香亚洲综合激情啪啪综合| 蜜桃av噜噜一区二区三区小说| 亚洲妇女屁股眼交7| 亚洲天堂网中文字| 国产视频在线观看一区二区三区| 日韩一区二区三区观看| 欧美精品aⅴ在线视频| 欧美性欧美巨大黑白大战| 色哟哟一区二区在线观看| 波多野结衣在线一区| 东方欧美亚洲色图在线| 国产不卡在线视频| 国产精品99久久久久久宅男| 国内精品国产三级国产a久久| 日韩av在线发布| 丝袜脚交一区二区| 午夜伊人狠狠久久| 五月激情综合网| 午夜在线成人av| 午夜久久久影院| 亚洲mv大片欧洲mv大片精品| 亚洲电影你懂得| 午夜精品久久久久久久久久| 亚洲h精品动漫在线观看| 香蕉加勒比综合久久| 丝袜国产日韩另类美女| 男男gaygay亚洲| 麻豆freexxxx性91精品| 久久 天天综合| 国产美女在线精品| 国产98色在线|日韩| 成人av网站免费| 日本韩国欧美一区| 欧美视频自拍偷拍| 欧美一区二区三区爱爱| 精品成a人在线观看| 国产日产亚洲精品系列| 亚洲欧洲av一区二区三区久久| 亚洲人成伊人成综合网小说| 伊人一区二区三区| 三级成人在线视频| 国产真实乱子伦精品视频| 成人亚洲精品久久久久软件| 色天天综合久久久久综合片| 欧美日韩午夜在线视频| 日韩精品一区在线| 中文字幕高清一区| 亚洲综合色婷婷| 麻豆传媒一区二区三区| 粉嫩绯色av一区二区在线观看| 91女人视频在线观看| 91精品欧美久久久久久动漫| 久久久99精品免费观看| 一区二区成人在线观看| 欧美96一区二区免费视频| 国产成人激情av| 欧美日韩免费不卡视频一区二区三区| 欧美电影免费观看高清完整版在线| 亚洲国产精品传媒在线观看| 亚洲一区二区三区美女| 国产一区二区三区四区五区美女| www.日本不卡| 欧美xxxxxxxx| 亚洲欧洲制服丝袜| 久久疯狂做爰流白浆xx| 色综合天天综合| 久久你懂得1024| 亚洲电影一区二区| 国产成都精品91一区二区三| 欧美午夜精品一区| 国产精品欧美综合在线| 日韩高清一区二区| 99久久99久久综合| 欧美一级二级三级蜜桃| 亚洲欧洲精品天堂一级| 精品在线免费视频| 欧美午夜精品一区二区三区| 欧美国产激情二区三区| 久久国产精品一区二区| 色噜噜偷拍精品综合在线| 久久久久久影视| 日本不卡一区二区三区高清视频| 成人国产精品免费观看| 久久综合久久综合久久| 视频一区二区欧美| 欧美在线免费观看亚洲| 国产日韩三级在线| 免费看精品久久片| 欧美日韩国产天堂| 亚洲日本一区二区| 国产69精品久久99不卡| 日韩欧美国产一区在线观看| 亚洲自拍偷拍综合| 91网址在线看| 国产精品久久毛片| 国产精品一区二区黑丝| 精品国产精品一区二区夜夜嗨| 亚洲成人免费视| 91色.com| 亚洲精选视频免费看| 91天堂素人约啪| 亚洲品质自拍视频| 成人动漫在线一区| 国产精品入口麻豆原神| 成人精品国产一区二区4080| 欧美极品少妇xxxxⅹ高跟鞋| 国产一区二区在线看| 精品粉嫩超白一线天av| 美国十次了思思久久精品导航| 欧美日韩精品二区第二页| 亚洲综合男人的天堂| 欧美亚一区二区| 香蕉久久夜色精品国产使用方法| 欧洲精品在线观看| 亚洲国产成人av| 欧美一区二区精品在线| 免费观看在线综合| 欧美成va人片在线观看| 日本视频中文字幕一区二区三区| 欧美伦理影视网| 另类调教123区| xnxx国产精品| 成人午夜精品一区二区三区| 国产精品欧美一级免费| 99在线精品观看| 一区二区三区四区中文字幕| 欧美三级在线播放| 美女网站视频久久| 久久久久久电影| 成人av动漫在线| 亚洲美女区一区| 欧美一区二区三区日韩视频| 麻豆精品新av中文字幕| 国产亚洲一区字幕| 99精品热视频| 图片区小说区区亚洲影院| 日韩精品一区二区三区在线播放| 久久av中文字幕片| 欧美国产欧美亚州国产日韩mv天天看完整| www.日韩在线| 五月激情综合色| 久久亚洲二区三区| 91福利国产精品| 激情六月婷婷久久| 国产精品久久久久aaaa| 欧美日韩另类一区|