亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
自拍偷拍亚洲欧美日韩| 久久久久国产一区二区三区四区| 欧美精品一区二区三区蜜臀| 一区二区免费在线播放| 国内精品久久久久影院色| 色8久久人人97超碰香蕉987| 久久久久久久久久久电影| 婷婷国产在线综合| 色久优优欧美色久优优| 国产精品伦一区| 狠狠色狠狠色综合系列| 欧美日韩视频第一区| 国产精品伦一区| 国产福利一区在线| 日韩免费一区二区| 视频一区二区国产| 在线影视一区二区三区| 亚洲欧洲av另类| 成人综合在线观看| 久久久久久一二三区| 美女被吸乳得到大胸91| 69堂精品视频| 亚洲a一区二区| 欧美日韩在线综合| 一区二区三区日本| 92国产精品观看| 国产精品久久久久久久久动漫| 韩国精品在线观看| 精品久久久久久久一区二区蜜臀| 婷婷一区二区三区| 3d成人h动漫网站入口| 亚洲成年人影院| 欧美在线999| 97se亚洲国产综合自在线不卡| 国产亚洲精品bt天堂精选| 国产剧情av麻豆香蕉精品| 久久久亚洲高清| 99麻豆久久久国产精品免费| 亚洲国产日韩综合久久精品| 精品一二三四区| 91在线云播放| 欧美日韩不卡视频| 国产不卡免费视频| 一区二区日韩电影| 欧美日韩中文另类| 一本久久综合亚洲鲁鲁五月天| 国产福利精品导航| 国产一区999| 中文字幕在线不卡视频| 成人动漫一区二区在线| 欧美经典一区二区| 99久久国产综合精品麻豆| 亚洲综合视频网| 2023国产一二三区日本精品2022| 福利一区二区在线| 亚洲大尺度视频在线观看| 欧美日韩激情一区二区三区| 91福利在线观看| 成人国产电影网| www.一区二区| 欧美性xxxxxxxx| 99精品1区2区| 色8久久人人97超碰香蕉987| 国产精一区二区三区| 麻豆一区二区99久久久久| 天堂影院一区二区| 韩日av一区二区| 国产精品1024| 蜜桃av一区二区| 国产精品一区二区在线观看不卡| 免费视频一区二区| 日日摸夜夜添夜夜添国产精品 | 亚洲免费资源在线播放| 欧美精品一区二区三| 色狠狠桃花综合| 福利电影一区二区| 欧美精品乱码久久久久久| 美女爽到高潮91| 一区二区三区在线视频播放| 久久综合狠狠综合久久激情| 99re热视频精品| av中文一区二区三区| caoporn国产精品| 成人免费毛片aaaaa**| 91影院在线免费观看| 99久久精品国产网站| 99久久免费精品高清特色大片| 国内偷窥港台综合视频在线播放| 成人国产精品免费观看视频| 在线中文字幕一区| 波多野洁衣一区| 精品国产青草久久久久福利| 国产91精品一区二区麻豆网站 | 另类综合日韩欧美亚洲| 中文一区在线播放| 欧美理论在线播放| 丰满白嫩尤物一区二区| 五月婷婷综合网| 中文一区二区在线观看| 欧美日韩国产另类一区| 国产成人精品影院| 视频一区欧美精品| 亚洲欧洲99久久| 337p粉嫩大胆色噜噜噜噜亚洲| 一本到高清视频免费精品| 美腿丝袜亚洲一区| 亚洲精品国产一区二区三区四区在线| 日韩免费电影网站| 在线免费观看不卡av| 国产成人精品免费网站| 偷窥少妇高潮呻吟av久久免费| 国产精品国产三级国产三级人妇| 欧美一卡二卡三卡| 欧美私人免费视频| 成人avav在线| 国产精品99久久久久久有的能看 | 欧美成人免费网站| 91久久精品国产91性色tv | 亚洲福利电影网| 国产精品美女一区二区在线观看| 日韩亚洲欧美高清| 在线看一区二区| 成人18视频在线播放| 经典三级一区二区| 日本午夜一区二区| 亚洲自拍欧美精品| 1000精品久久久久久久久| 26uuu国产在线精品一区二区| 欧美久久高跟鞋激| 在线亚洲一区二区| eeuss国产一区二区三区| 国产精品资源网| 麻豆91在线播放| 天天综合色天天综合| 亚洲综合丁香婷婷六月香| 亚洲天堂精品在线观看| 欧美经典一区二区三区| 日韩一区二区三区免费看| 欧美日韩一级二级| 色婷婷国产精品久久包臀| 成人av网站在线| 成人精品免费视频| 国产精品888| 国产精品自产自拍| 国产一区二区三区四区五区入口| 美女一区二区三区| 免费成人你懂的| 美女性感视频久久| 久久精品99国产精品日本| 日本欧美肥老太交大片| 日韩电影免费在线| 日本色综合中文字幕| 肉肉av福利一精品导航| 丝袜美腿亚洲综合| 日本午夜一本久久久综合| 免费高清在线视频一区·| 日韩福利视频网| 麻豆精品久久精品色综合| 久热成人在线视频| 狠狠色丁香婷综合久久| 国产在线播放一区三区四| 久久成人久久爱| 九九久久精品视频| 国产一二精品视频| 大桥未久av一区二区三区中文| 丁香桃色午夜亚洲一区二区三区| 国产91精品入口| 波多野结衣一区二区三区| 99久久综合99久久综合网站| 99热在这里有精品免费| 色噜噜狠狠成人网p站| 欧美色图天堂网| 91精品国产91热久久久做人人| 日韩区在线观看| 国产午夜三级一区二区三| 国产精品美女久久久久aⅴ| 亚洲日本一区二区| 午夜激情一区二区| 国产在线观看一区二区| 成人精品视频一区| 欧美亚洲动漫制服丝袜| 欧美一区二区视频在线观看| 精品国产91亚洲一区二区三区婷婷| 久久精品一区二区| 亚洲欧美一区二区久久| 午夜一区二区三区视频| 久久激情五月激情| 成人av网站在线| 欧美日本韩国一区| 国产视频一区在线观看| 一区二区三区四区激情| 日韩精品亚洲专区| 国产福利视频一区二区三区| 色婷婷久久综合| 日韩欧美在线影院| 中文字幕中文在线不卡住| 亚洲第一激情av| 国产激情91久久精品导航| 91麻豆成人久久精品二区三区| 91精品婷婷国产综合久久竹菊|