亚洲欧美第一页_禁久久精品乱码_粉嫩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	virtual void clear();	//! clear gradients dx	virtual void clear_dx();	//! clear diag hessians ddx	virtual void clear_ddx();	//! return number of elements	virtual intg nelements();	//! return footprint in storages	virtual intg footprint();	//! same as footprint	virtual 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一区二区三区免费野_久草精品视频
亚洲综合丝袜美腿| www.日本不卡| 精品一区二区三区av| 青青草精品视频| 日韩高清在线一区| 日本在线不卡视频| 麻豆精品一区二区三区| 免费看欧美美女黄的网站| 视频一区二区三区入口| 秋霞国产午夜精品免费视频| 日本vs亚洲vs韩国一区三区二区| 日韩高清在线一区| 蜜桃视频一区二区三区| 久久69国产一区二区蜜臀| 国模套图日韩精品一区二区| 国产电影一区在线| 成人高清在线视频| 在线观看视频一区| 91精品婷婷国产综合久久竹菊| 日韩三级视频在线看| 精品动漫一区二区三区在线观看| 久久久久久久久99精品| 中文字幕中文字幕一区| 一区二区三区四区精品在线视频| 亚洲成人你懂的| 美女视频网站黄色亚洲| 国产精品一二一区| 99久久精品免费看| 欧美日韩精品综合在线| 欧美xingq一区二区| 中文字幕第一区| 一区二区免费在线播放| 美女久久久精品| zzijzzij亚洲日本少妇熟睡| 欧美综合亚洲图片综合区| 51精品久久久久久久蜜臀| 国产婷婷色一区二区三区四区| 亚洲视频一二三| 日本免费新一区视频| 成人久久久精品乱码一区二区三区| 91免费观看国产| 欧美一区二区三区免费视频 | 欧美日韩一级片在线观看| 日韩精品一区在线观看| 国产精品免费网站在线观看| 亚洲高清免费在线| 国内精品国产成人国产三级粉色| 99视频有精品| 亚洲免费色视频| 久久成人麻豆午夜电影| 成人av电影在线观看| 在线播放日韩导航| 国产精品日日摸夜夜摸av| 肉色丝袜一区二区| 成人激情小说网站| 在线播放日韩导航| 中文字幕一区二区三区在线播放 | av午夜一区麻豆| 欧美高清精品3d| 国产精品美女久久久久aⅴ| 午夜影视日本亚洲欧洲精品| 国产91精品一区二区麻豆亚洲| 欧美日韩三级一区| 国产精品高清亚洲| 蜜臀av性久久久久蜜臀aⅴ四虎| 色综合久久久久综合体桃花网| 精品国产一区久久| 午夜电影网一区| 99久久综合色| 成人激情免费网站| 91免费看`日韩一区二区| 欧美一区二区三区婷婷月色| 亚洲欧美国产毛片在线| 国产一区二区精品久久91| 欧美日韩一区二区三区视频 | 亚洲蜜臀av乱码久久精品| 精品一区二区在线观看| 日本高清不卡aⅴ免费网站| 国产精品美女一区二区| 国产精品99久久久久久久女警 | 亚洲一区二区欧美激情| 国产a级毛片一区| 欧美成人精品高清在线播放| 图片区小说区国产精品视频| 91首页免费视频| 中文字幕亚洲区| 国v精品久久久网| 久久综合国产精品| 麻豆国产精品官网| 91精品国产综合久久香蕉的特点| 欧美另类久久久品| 成人午夜av影视| 久久亚洲一区二区三区明星换脸 | 精品一区二区三区免费播放| 欧美视频在线观看一区二区| 亚洲欧美日韩一区| 99re免费视频精品全部| 国产精品女主播av| 国产成a人无v码亚洲福利| 精品久久久影院| 韩国v欧美v日本v亚洲v| wwww国产精品欧美| 国产精品一品视频| 欧美激情综合在线| 成人免费精品视频| 国产精品久线在线观看| www..com久久爱| 中文字幕综合网| 99re热这里只有精品视频| 亚洲免费观看高清完整版在线观看熊| 99国产精品久久久久久久久久久 | 午夜精品久久久久| 欧美裸体一区二区三区| 午夜精品福利在线| 91精品国产综合久久蜜臀| 一本久道久久综合中文字幕 | 亚洲午夜精品一区二区三区他趣| 中文字幕av在线一区二区三区| 国产伦精品一区二区三区在线观看 | 国产一区高清在线| 亚洲精品一区二区精华| 婷婷综合五月天| 色成人在线视频| 亚洲一二三四区不卡| 一本大道久久a久久精二百| 亚洲日本电影在线| hitomi一区二区三区精品| 亚洲免费观看在线视频| 欧美影院一区二区| 亚洲在线观看免费| 在线不卡一区二区| 麻豆传媒一区二区三区| 国产欧美日韩综合| 不卡av电影在线播放| 国产精品久久二区二区| 色综合久久中文综合久久牛| 午夜精品福利视频网站| 日韩美一区二区三区| 国产毛片精品一区| 国产精品国产三级国产三级人妇| 国产精品资源站在线| 亚洲精品一卡二卡| 欧美日韩一区 二区 三区 久久精品| 午夜精品久久久久久久| 精品国产一二三| 国产在线播精品第三| 亚洲男人的天堂av| 欧美久久久久免费| 国内精品久久久久影院色| 国产精品视频你懂的| 欧美一区二区三区啪啪| 久久99久久久久久久久久久| 欧美大片在线观看| 91麻豆国产福利在线观看| 亚洲国产婷婷综合在线精品| 欧美一区二区三区四区五区| 国产尤物一区二区| 亚洲自拍偷拍网站| 日韩午夜av一区| 粉嫩蜜臀av国产精品网站| 亚洲精品乱码久久久久久日本蜜臀| 欧美日韩中文精品| www.一区二区| 日韩高清不卡一区二区三区| 久久久久久免费网| 精品视频一区 二区 三区| 国产一区二区不卡| 一区二区三区在线影院| 亚洲精品一区二区三区福利| 色菇凉天天综合网| 青青青伊人色综合久久| 一级精品视频在线观看宜春院| 欧美一卡在线观看| www.欧美精品一二区| 久久成人免费网| 亚洲一区二区在线视频| 久久综合九色综合欧美亚洲| 色av一区二区| 国产麻豆精品在线观看| 亚洲小说欧美激情另类| 国产欧美综合在线| 欧美美女bb生活片| 成人成人成人在线视频| 美日韩黄色大片| 亚洲激情av在线| 国产色综合久久| 精品国产乱码久久久久久影片| 色婷婷国产精品| 国产成人精品免费在线| 日韩精品电影一区亚洲| 国产色综合一区| 久久久久88色偷偷免费| 91精品中文字幕一区二区三区| 99精品视频在线播放观看| 激情图片小说一区| 韩国av一区二区三区四区| 亚洲成av人影院| 亚洲人一二三区| 国产精品久久久一本精品 | 日韩精品一区二区三区swag|