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

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

?? hmc.m

?? 高斯過程是一種非參數化的學習方法
?? M
字號:
function [samples, energies, diagn] = hmc(f, x, options, gradf, varargin)%HMC	Hybrid Monte Carlo sampling.%%	Description%	SAMPLES = HMC(F, X, OPTIONS, GRADF) uses a  hybrid Monte Carlo%	algorithm to sample from the distribution P ~ EXP(-F), where F is the%	first argument to HMC. The Markov chain starts at the point X, and%	the function GRADF is the gradient of the `energy' function F.%%	HMC(F, X, OPTIONS, GRADF, P1, P2, ...) allows additional arguments to%	be passed to F() and GRADF().%%	[SAMPLES, ENERGIES, DIAGN] = HMC(F, X, OPTIONS, GRADF) also returns a%	log of the energy values (i.e. negative log probabilities) for the%	samples in ENERGIES and DIAGN, a structure containing diagnostic%	information (position, momentum and acceptance threshold) for each%	step of the chain in DIAGN.POS, DIAGN.MOM and DIAGN.ACC respectively.%	All candidate states (including rejected ones) are stored in%	DIAGN.POS.%%	[SAMPLES, ENERGIES, DIAGN] = HMC(F, X, OPTIONS, GRADF) also returns%	the ENERGIES (i.e. negative log probabilities) corresponding to the%	samples.  The DIAGN structure contains three fields:%%	POS the position vectors of the dynamic process.%%	MOM the momentum vectors of the dynamic process.%%	ACC the acceptance thresholds.%%	S = HMC('STATE') returns a state structure that contains the state of%	the two random number generators RAND and RANDN and the momentum of%	the dynamic process.  These are contained in fields  randstate,%	randnstate and mom respectively.  The momentum state is only used for%	a persistent momentum update.%%	HMC('STATE', S) resets the state to S.  If S is an integer, then it%	is passed to RAND and RANDN and the momentum variable is randomised.%	If S is a structure returned by HMC('STATE') then it resets the%	generator to exactly the same state.%%	The optional parameters in the OPTIONS vector have the following%	interpretations.%%	OPTIONS(1) is set to 1 to display the energy values and rejection%	threshold at each step of the Markov chain. If the value is 2, then%	the position vectors at each step are also displayed.%%	OPTIONS(5) is set to 1 if momentum persistence is used; default 0,%	for complete replacement of momentum variables.%%	OPTIONS(7) defines the trajectory length (i.e. the number of leap-%	frog steps at each iteration).  Minimum value 1.%%	OPTIONS(9) is set to 1 to check the user defined gradient function.%%	OPTIONS(14) is the number of samples retained from the Markov chain;%	default 100.%%	OPTIONS(15) is the number of samples omitted from the start of the%	chain; default 0.%%	OPTIONS(17) defines the momentum used when a persistent update of%	(leap-frog) momentum is used.  This is bounded to the interval [0,%	1).%%	OPTIONS(18) is the step size used in leap-frogs; default 1/trajectory%	length.%%	See also%	METROP%%	Copyright (c) Ian T Nabney (1996-2001)% Global variable to store state of momentum variables: set by set_state% Used to initialise variable if setglobal HMC_MOMif nargin <= 2  if ~strcmp(f, 'state')    error('Unknown argument to hmc');  end  switch nargin    case 1      samples = get_state(f);      return;    case 2      set_state(f, x);      return;  endenddisplay = options(1);if (round(options(5) == 1))  persistence = 1;  % Set alpha to lie in [0, 1)  alpha = max(0, options(17));  alpha = min(1, alpha);  salpha = sqrt(1-alpha*alpha);else  persistence = 0;endL = max(1, options(7)); % At least one step in leap-froggingif options(14) > 0  nsamples = options(14);else  nsamples = 100;	% Defaultendif options(15) >= 0  nomit = options(15);else  nomit = 0;endif options(18) > 0  step_size = options(18);	% Step size.else  step_size = 1/L;		% Default  endx = x(:)';		% Force x to be a row vectornparams = length(x);% Set up strings for evaluating potential function and its gradient.f = fcnchk(f, length(varargin));gradf = fcnchk(gradf, length(varargin));% Check the gradient evaluation.if (options(9))  % Check gradients  feval('gradchek', x, f, gradf, varargin{:});endsamples = zeros(nsamples, nparams);	% Matrix of returned samples.if nargout >= 2  en_save = 1;  energies = zeros(nsamples, 1);else  en_save = 0;endif nargout >= 3  diagnostics = 1;  diagn_pos = zeros(nsamples, nparams);  diagn_mom = zeros(nsamples, nparams);  diagn_acc = zeros(nsamples, 1);else  diagnostics = 0;endn = - nomit + 1;Eold = feval(f, x, varargin{:});	% Evaluate starting energy.nreject = 0;if (~persistence | isempty(HMC_MOM))  p = randn(1, nparams);		% Initialise momenta at randomelse  p = HMC_MOM;				% Initialise momenta from stored stateendlambda = 1;% Main loop.while n <= nsamples  xold = x;		    % Store starting position.  pold = p;		    % Store starting momenta  Hold = Eold + 0.5*(p*p'); % Recalculate Hamiltonian as momenta have changed  if ~persistence    % Choose a direction at random    if (rand < 0.5)      lambda = -1;    else      lambda = 1;    end  end  % Perturb step length.  epsilon = lambda*step_size*(1.0 + 0.1*randn(1));  % First half-step of leapfrog.  p = p - 0.5*epsilon*feval(gradf, x, varargin{:});  x = x + epsilon*p;    % Full leapfrog steps.  for m = 1 : L - 1    p = p - epsilon*feval(gradf, x, varargin{:});    x = x + epsilon*p;  end  % Final half-step of leapfrog.  p = p - 0.5*epsilon*feval(gradf, x, varargin{:});  % Now apply Metropolis algorithm.  Enew = feval(f, x, varargin{:});	% Evaluate new energy.  p = -p;				% Negate momentum  Hnew = Enew + 0.5*p*p';		% Evaluate new Hamiltonian.  a = exp(Hold - Hnew);			% Acceptance threshold.  if (diagnostics & n > 0)    diagn_pos(n,:) = x;    diagn_mom(n,:) = p;    diagn_acc(n,:) = a;  end  if (display > 1)    fprintf(1, 'New position is\n');    disp(x);  end  if a > rand(1)			% Accept the new state.    Eold = Enew;			% Update energy    if (display > 0)      fprintf(1, 'Finished step %4d  Threshold: %g\n', n, a);    end  else					% Reject the new state.    if n > 0       nreject = nreject + 1;    end    x = xold;				% Reset position     p = pold;   			% Reset momenta    if (display > 0)      fprintf(1, '  Sample rejected %4d.  Threshold: %g\n', n, a);    end  end  if n > 0    samples(n,:) = x;			% Store sample.    if en_save       energies(n) = Eold;		% Store energy.    end  end  % Set momenta for next iteration  if persistence    p = -p;    % Adjust momenta by a small random amount.    p = alpha.*p + salpha.*randn(1, nparams);  else    p = randn(1, nparams);	% Replace all momenta.  end  n = n + 1;endif (display > 0)  fprintf(1, '\nFraction of samples rejected:  %g\n', ...    nreject/(nsamples));endif diagnostics  diagn.pos = diagn_pos;  diagn.mom = diagn_mom;  diagn.acc = diagn_acc;end% Store final momentum value in global so that it can be retrieved laterHMC_MOM = p;return% Return complete state of sampler (including momentum)function state = get_state(f)global HMC_MOMstate.randstate = rand('state');state.randnstate = randn('state');state.mom = HMC_MOM;return% Set complete state of sampler (including momentum) or just set randn% and rand with integer argument.function set_state(f, x)global HMC_MOMif isnumeric(x)  rand('state', x);  randn('state', x);  HMC_MOM = [];else  if ~isstruct(x)    error('Second argument to hmc must be number or state structure');  end  if (~isfield(x, 'randstate') | ~isfield(x, 'randnstate') ...      | ~isfield(x, 'mom'))    error('Second argument to hmc must contain correct fields')  end  rand('state', x.randstate);  randn('state', x.randnstate);  HMC_MOM = x.mom;endreturn

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91色视频在线| 久久久九九九九| wwwwxxxxx欧美| 一区二区三区四区五区视频在线观看| 久久狠狠亚洲综合| 色呦呦国产精品| 国产亚洲视频系列| 精品系列免费在线观看| 欧美猛男男办公室激情| 亚洲精品综合在线| av网站一区二区三区| 久久伊人中文字幕| 奇米综合一区二区三区精品视频| 在线影院国内精品| 亚洲色图视频网站| 成人激情免费视频| 国产女人18毛片水真多成人如厕 | 精品一区二区三区免费| 欧美性videosxxxxx| 日韩一区中文字幕| 99在线精品观看| 中文字幕一区二区三| 成人性色生活片免费看爆迷你毛片| 精品国产污网站| 国产综合一区二区| 国产亚洲一区二区三区在线观看| 精品制服美女久久| 欧美成人官网二区| 精品制服美女丁香| 精品国产不卡一区二区三区| 久久精品国产99国产| 精品国产伦一区二区三区观看方式 | 亚洲aⅴ怡春院| 欧美日韩精品久久久| 亚洲午夜久久久久| 欧美日韩国产综合视频在线观看 | 在线精品观看国产| 亚洲妇女屁股眼交7| 欧美日韩日本视频| 日韩精品国产精品| 精品国产三级a在线观看| 韩国在线一区二区| 日本一区二区免费在线观看视频| 国产成人av电影在线| 国产精品美女久久久久久久久| 成人av电影在线| 亚洲一区二区在线观看视频| 欧美男男青年gay1069videost| 日韩国产欧美在线视频| 精品日本一线二线三线不卡| 国产精品888| 一区二区三区欧美日韩| 欧美高清精品3d| 黄色成人免费在线| 亚洲天堂2016| 日韩小视频在线观看专区| 国产乱子伦视频一区二区三区| 中文字幕av一区二区三区高| 欧美在线免费播放| 国产一区二区免费视频| 日韩毛片精品高清免费| 欧美一区二区女人| 成人avav影音| 日本亚洲免费观看| 中文字幕一区二区三区不卡在线| 欧美日韩在线直播| 国产成人亚洲精品青草天美| 一区二区三区免费看视频| 欧美一级久久久| 91免费版在线| 韩国中文字幕2020精品| 一区二区三区不卡视频在线观看| 日韩欧美高清在线| 色视频成人在线观看免| 国产一区二区按摩在线观看| 亚洲国产美女搞黄色| 国产欧美日韩三级| 欧美高清性hdvideosex| 91在线视频网址| 国产一区二区三区在线观看免费| 亚洲午夜日本在线观看| 国产农村妇女毛片精品久久麻豆| 欧美日韩亚洲另类| 成人在线视频一区| 久久超碰97人人做人人爱| 亚洲一区二区在线观看视频| 国产精品网站在线播放| 精品毛片乱码1区2区3区| 欧美性色黄大片手机版| 成人激情图片网| 国产精品综合在线视频| 日韩国产在线观看| 亚洲午夜在线视频| 亚洲丝袜自拍清纯另类| 国产女人18水真多18精品一级做| 欧美电视剧在线看免费| 欧美日韩情趣电影| 色婷婷精品大在线视频| 成人美女在线视频| 色婷婷综合久久| 国产精品911| 国产精品综合二区| 精品一区二区三区香蕉蜜桃 | 88在线观看91蜜桃国自产| 一本色道综合亚洲| 成人av手机在线观看| 不卡的av电影| 99精品视频一区二区三区| 国产精品18久久久久久vr| 经典三级视频一区| 加勒比av一区二区| 国产一区二区免费视频| 国产福利不卡视频| 国产成人aaaa| av在线一区二区| 日本韩国精品在线| 欧美午夜不卡在线观看免费| 在线视频一区二区免费| 欧美色综合天天久久综合精品| 色欧美片视频在线观看| 欧美午夜片在线观看| 在线电影院国产精品| 777a∨成人精品桃花网| 欧美成人精品高清在线播放| 久久嫩草精品久久久精品一| 国产三级久久久| 中文字幕亚洲精品在线观看| 亚洲猫色日本管| 五月综合激情婷婷六月色窝| 午夜精品123| 国产伦精品一区二区三区视频青涩| 国产乱码一区二区三区| 成人黄色国产精品网站大全在线免费观看 | 日韩一级片网站| 精品久久国产字幕高潮| 国产欧美一区在线| 亚洲一区二区精品视频| 日av在线不卡| 成人午夜电影网站| 欧美日韩aaaaaa| 国产亚洲制服色| 一区二区三区日韩欧美精品| 日本成人在线电影网| 国产91在线看| 欧美日韩一区二区三区视频| 精品理论电影在线| 日韩电影免费在线观看网站| 日本一区二区三区视频视频| 国产女人aaa级久久久级| 亚洲欧美国产三级| 青青国产91久久久久久| 国产91露脸合集magnet | 国产精品久久精品日日| 亚洲精品免费播放| 精品一区二区久久| 日本高清不卡视频| 2欧美一区二区三区在线观看视频| 国产精品福利一区二区| 日本不卡的三区四区五区| 国产精品911| 91麻豆精品久久久久蜜臀| 国产精品人成在线观看免费| 日日摸夜夜添夜夜添国产精品| 国产精品91一区二区| 欧美老肥妇做.爰bbww视频| 亚洲国产美女搞黄色| 免费成人在线播放| 91官网在线观看| 国产欧美va欧美不卡在线| 日本免费新一区视频| 色综合网色综合| 久久久亚洲午夜电影| 琪琪久久久久日韩精品| 日本高清不卡在线观看| 国产精品私人自拍| 久久精品国产秦先生| 欧美色综合网站| 亚洲人成7777| 成人精品免费视频| 久久嫩草精品久久久精品| 日日夜夜精品视频免费| 欧美三级三级三级爽爽爽| 亚洲日本在线视频观看| 懂色av一区二区三区蜜臀| 欧美岛国在线观看| 首页国产欧美久久| 欧美性感一类影片在线播放| 亚洲精品免费播放| 色天使久久综合网天天| 综合久久久久久| av高清久久久| 中文字幕一区二区三区色视频| 国产成人精品一区二区三区四区| 日韩欧美国产三级| 九色|91porny| 久久精品亚洲乱码伦伦中文| 国产成人在线看| 国产精品三级久久久久三级| 成人国产视频在线观看| 国产精品色眯眯|