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

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

?? hmc.m

?? The goal of SPID is to provide the user with tools capable to simulate, preprocess, process and clas
?? 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精品国产91久久久久久最新毛片| 欧美久久久久久久久久| 欧美一区二区三区视频| 日韩一区二区三区观看| 欧美videofree性高清杂交| 精品国产精品网麻豆系列| 久久综合久久综合亚洲| 国产精品欧美极品| 亚洲视频1区2区| 偷偷要91色婷婷| 国产精品一卡二| 91视频.com| 69堂精品视频| 国产无人区一区二区三区| 国产精品免费久久| 亚洲国产视频直播| 韩日精品视频一区| 99视频在线精品| 8x福利精品第一导航| 一区在线观看免费| 天天操天天干天天综合网| 国产在线精品一区二区夜色| 91日韩在线专区| 日韩欧美亚洲另类制服综合在线| 国产精品私人影院| 午夜视频在线观看一区二区| 国产高清精品网站| 欧美日本精品一区二区三区| 日本一区二区免费在线观看视频 | 欧美午夜精品一区二区三区| 日韩美女主播在线视频一区二区三区| 国产欧美视频在线观看| 舔着乳尖日韩一区| 成人理论电影网| 欧美大白屁股肥臀xxxxxx| 亚洲欧美一区二区三区极速播放 | 精品国产伦一区二区三区观看方式| 久久精品亚洲精品国产欧美| 午夜精品久久久久久久99樱桃| 国产精品一区二区在线播放| 7878成人国产在线观看| 国产精品久久久久永久免费观看| 日日骚欧美日韩| 色哟哟国产精品免费观看| 久久精品一区二区三区不卡| 日韩高清一区二区| 91网页版在线| 国产精品天天摸av网| 韩国欧美国产一区| 欧美高清精品3d| 亚洲一区二区中文在线| 精品视频一区二区不卡| 亚洲欧洲精品成人久久奇米网 | 日韩精品一区二区在线| 亚洲精品国产第一综合99久久| 成人免费的视频| 国产日韩欧美精品一区| 国产在线播精品第三| 欧美mv和日韩mv国产网站| 蜜臀av性久久久久av蜜臀妖精 | 欧美成人猛片aaaaaaa| 偷拍日韩校园综合在线| 欧美影视一区在线| 亚洲综合免费观看高清完整版在线| 成人激情午夜影院| 久久久久久免费毛片精品| 国模少妇一区二区三区| 欧美va在线播放| 国产精品中文字幕日韩精品| 国产欧美日韩在线| www.久久精品| 亚洲欧美区自拍先锋| 日本高清视频一区二区| 亚洲精品免费一二三区| 欧美中文字幕一区| 午夜视频一区二区三区| 日韩午夜中文字幕| 国产在线不卡一区| 国产精品国产三级国产a| 成人午夜电影网站| 亚洲免费资源在线播放| 欧美性生活大片视频| 无码av免费一区二区三区试看| 这里只有精品电影| 国产美女精品人人做人人爽| 国产精品久久久久影视| 欧洲一区在线电影| 蜜臀av性久久久久蜜臀aⅴ流畅 | 欧美性受极品xxxx喷水| 日韩国产精品91| 26uuu另类欧美亚洲曰本| 国产不卡视频在线播放| 亚洲综合男人的天堂| 欧美一级电影网站| 成人国产电影网| 丝袜美腿亚洲色图| 久久亚洲影视婷婷| 欧美又粗又大又爽| 韩国成人在线视频| 亚洲图片一区二区| 久久亚洲精精品中文字幕早川悠里| 色婷婷综合久久久中文一区二区 | 国产日韩精品久久久| 一本色道久久加勒比精品 | 精品99一区二区三区| av在线不卡免费看| 蜜桃av一区二区| 综合久久综合久久| 欧美成人精精品一区二区频| 99re热这里只有精品视频| 蜜臀久久久99精品久久久久久| 国产亲近乱来精品视频| 欧美精品丝袜久久久中文字幕| 成人网男人的天堂| 狂野欧美性猛交blacked| ...av二区三区久久精品| 欧美成人精品1314www| 欧美伊人久久大香线蕉综合69 | 亚洲免费观看高清完整版在线 | 久久精品欧美一区二区三区不卡| 欧美日韩专区在线| 99国产一区二区三精品乱码| 国产一区福利在线| 日韩在线一区二区三区| 亚洲免费观看视频| 亚洲欧美精品午睡沙发| 国产欧美一二三区| 久久久久国产精品人| 日韩网站在线看片你懂的| 欧美日韩精品一区二区三区蜜桃 | 懂色av一区二区三区免费看| 美女看a上一区| 爽好久久久欧美精品| 一区二区高清免费观看影视大全 | 欧美日韩日日夜夜| 99久久99久久综合| 99久久精品免费| 成人h动漫精品一区二区| 国产精品正在播放| 韩国av一区二区三区在线观看| 蜜桃一区二区三区在线观看| 日韩电影一区二区三区| 午夜亚洲福利老司机| 丝袜诱惑亚洲看片| 午夜伊人狠狠久久| 午夜精品福利一区二区三区av | 欧美羞羞免费网站| 91福利在线免费观看| 91女厕偷拍女厕偷拍高清| 99综合影院在线| 色拍拍在线精品视频8848| 一本一本大道香蕉久在线精品 | 日本最新不卡在线| 秋霞成人午夜伦在线观看| 久久99久久精品欧美| 狠狠色丁香婷综合久久| 国产成人精品免费| 不卡区在线中文字幕| 色婷婷av一区二区三区大白胸| 91久久国产最好的精华液| 欧美日韩日日夜夜| 日韩精品影音先锋| 中文av一区特黄| 亚洲国产精品精华液网站| 美女尤物国产一区| 成人午夜免费电影| 色天使色偷偷av一区二区| 欧美一区二区在线观看| 久久综合九色综合欧美亚洲| 国产精品美女久久久久av爽李琼| 亚洲女人的天堂| 日本伊人精品一区二区三区观看方式| 国内成人自拍视频| 99在线视频精品| 日韩一区二区三区在线观看| 中文字幕欧美三区| 亚洲综合男人的天堂| 国产一区二区三区免费在线观看| 99精品国产一区二区三区不卡| 这里是久久伊人| 亚洲欧美国产77777| 毛片av一区二区| 色狠狠桃花综合| 国产亚洲成av人在线观看导航| 亚洲伊人色欲综合网| 国产盗摄精品一区二区三区在线| 欧洲精品在线观看|