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

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

?? hmc.m

?? Matlab toolbox that contains functions of Kalman filter and random system simulation.
?? 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一区二区三区免费野_久草精品视频
免费视频一区二区| 日韩一区二区三免费高清| 精品粉嫩超白一线天av| 视频一区欧美日韩| 欧美人伦禁忌dvd放荡欲情| 一区二区三区高清在线| 欧美亚洲动漫精品| 青青草原综合久久大伊人精品| 亚洲色大成网站www久久九九| 99天天综合性| 五月婷婷综合在线| 久久精品亚洲国产奇米99| 成人在线视频一区| 亚洲国产精品久久人人爱蜜臀 | 久久精品夜夜夜夜久久| 久久久蜜桃精品| 欧美性色欧美a在线播放| 欧美午夜一区二区| 欧美肥胖老妇做爰| 不卡在线观看av| 久久精品久久综合| 亚洲美女在线国产| 国产精品久久久久一区二区三区| 欧美日韩黄色一区二区| 在线观看91av| www精品美女久久久tv| 欧美影院午夜播放| 日韩免费性生活视频播放| 在线观看日韩高清av| 成人网男人的天堂| 99久久综合国产精品| 91久久精品网| 高清不卡一二三区| 精品一区二区久久久| 午夜视频久久久久久| 国产盗摄一区二区| 国产一区二区免费视频| 日韩av高清在线观看| 亚洲最色的网站| 久久99久久99小草精品免视看| 国产成人亚洲综合a∨婷婷图片| 91福利国产成人精品照片| 欧美大白屁股肥臀xxxxxx| 91在线视频免费观看| 99久久久精品| 在线综合+亚洲+欧美中文字幕| 在线免费观看一区| 久久综合九色综合欧美亚洲| 樱桃国产成人精品视频| 亚洲私人影院在线观看| 奇米精品一区二区三区在线观看一| 国产69精品久久777的优势| 欧美日韩一二区| 91超碰这里只有精品国产| 国产精品卡一卡二卡三| 日本午夜一区二区| 欧美日韩一级大片网址| 亚洲欧美日韩一区| 成人性生交大片免费看中文| 日韩美女主播在线视频一区二区三区 | 欧美精品一区二区三区在线| 亚洲欧美激情视频在线观看一区二区三区 | 国产三级欧美三级| 日韩免费电影网站| 午夜精品久久久久久久| 91麻豆精品秘密| 欧美亚洲日本一区| 亚洲欧美精品午睡沙发| 成人美女在线视频| 国产日韩欧美综合在线| 激情丁香综合五月| av电影在线观看完整版一区二区| 精品欧美久久久| 免费精品视频最新在线| 欧美高清www午色夜在线视频| 亚洲男人的天堂在线aⅴ视频| 丁香激情综合国产| 国产蜜臀97一区二区三区| 国产精品资源在线看| 欧洲日韩一区二区三区| 亚洲精品国产a久久久久久| 99re66热这里只有精品3直播 | 亚洲最新视频在线观看| 99久久99久久精品国产片果冻| 国产欧美日韩在线看| 高清国产一区二区| 国产精品久久777777| 99久久久久久99| 亚洲欧美日韩中文字幕一区二区三区| 色偷偷一区二区三区| 日韩一级高清毛片| 青青草国产精品97视觉盛宴| 精品国产欧美一区二区| 激情图片小说一区| 亚洲国产成人在线| 免费成人小视频| 久久综合久久综合久久| 懂色av一区二区三区免费看| 国产日产欧产精品推荐色| 99精品国产91久久久久久| 亚洲最新视频在线播放| 欧美成人video| av在线这里只有精品| 亚洲综合一二三区| 波多野结衣在线aⅴ中文字幕不卡| 国产精品日韩成人| 国产精品66部| 亚洲欧美日韩系列| 欧美成人在线直播| 99re这里只有精品首页| 日韩av中文在线观看| 国产三级精品视频| 在线精品视频一区二区三四| 蜜乳av一区二区三区| 欧美日韩一区二区电影| 国产伦精一区二区三区| 亚洲精品v日韩精品| 精品国产免费久久| 91啪九色porn原创视频在线观看| 日韩在线a电影| 国产精品免费视频网站| 欧美一区二区精品在线| 日韩av午夜在线观看| 国产精品不卡一区| 欧美v亚洲v综合ⅴ国产v| 91丨九色丨黑人外教| 久久精品国产免费| 亚洲自拍偷拍九九九| 国产视频一区二区在线| 欧美乱妇20p| 99久久久久久| 丁香一区二区三区| 日本欧美在线看| 一区二区三区视频在线观看| 国产午夜亚洲精品羞羞网站| 欧美日韩国产色站一区二区三区| 成人性视频网站| 国产麻豆精品在线| 日本午夜一本久久久综合| 亚洲一区二区偷拍精品| 国产精品二区一区二区aⅴ污介绍| 欧美xfplay| 日韩一区二区三区在线观看| 欧美日韩久久久久久| 在线观看三级视频欧美| 91蝌蚪porny| a级精品国产片在线观看| 国产91丝袜在线播放0| 国产一区高清在线| 精品制服美女丁香| 久久精品久久精品| 蜜臀va亚洲va欧美va天堂| 日本欧美加勒比视频| 午夜精品一区二区三区免费视频 | 青青草伊人久久| 免费观看成人av| 日韩激情视频网站| 麻豆精品精品国产自在97香蕉| 日韩影院精彩在线| 捆绑紧缚一区二区三区视频| 免费国产亚洲视频| 国产综合色产在线精品| 国产精品一区在线观看你懂的| 精品一区二区三区在线观看 | 欧美三区在线观看| 欧美日韩精品免费| 91精品国产综合久久婷婷香蕉 | 欧美视频一区在线| 欧美日产在线观看| 欧美大肚乱孕交hd孕妇| 久久久www成人免费毛片麻豆| 久久综合狠狠综合| 亚洲国产精品成人久久综合一区| 国产精品婷婷午夜在线观看| 亚洲欧洲国产日韩| 精品国产伦一区二区三区免费| 2024国产精品| 国产精品久久久久久久蜜臀| 中文字幕一区二区三区av| 亚洲裸体xxx| 午夜影院久久久| 亚洲欧美色综合| 日韩高清一级片| 丁香啪啪综合成人亚洲小说| 色菇凉天天综合网| 欧美成人一区二区三区| 亚洲视频在线观看一区| 日日欢夜夜爽一区| 成人免费视频国产在线观看| 在线影视一区二区三区| 欧美一区二区三区电影| 欧美经典三级视频一区二区三区| 亚洲精品日韩一| 久久er精品视频| 在线观看欧美精品| 久久久青草青青国产亚洲免观| 一区二区三区在线视频免费观看| 麻豆国产欧美日韩综合精品二区| 99久久亚洲一区二区三区青草 | 色综合一区二区三区|