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

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

?? hmc.m

?? 利用HMM的方法的三種語音識別算法
?? 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 set
global HMC_MOM
if 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;
  end
end

display = 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;
end
L = max(1, options(7)); % At least one step in leap-frogging
if options(14) > 0
  nsamples = options(14);
else
  nsamples = 100;	% Default
end
if options(15) >= 0
  nomit = options(15);
else
  nomit = 0;
end
if options(18) > 0
  step_size = options(18);	% Step size.
else
  step_size = 1/L;		% Default  
end
x = x(:)';		% Force x to be a row vector
nparams = 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{:});
end

samples = zeros(nsamples, nparams);	% Matrix of returned samples.
if nargout >= 2
  en_save = 1;
  energies = zeros(nsamples, 1);
else
  en_save = 0;
end
if nargout >= 3
  diagnostics = 1;
  diagn_pos = zeros(nsamples, nparams);
  diagn_mom = zeros(nsamples, nparams);
  diagn_acc = zeros(nsamples, 1);
else
  diagnostics = 0;
end

n = - nomit + 1;
Eold = feval(f, x, varargin{:});	% Evaluate starting energy.
nreject = 0;
if (~persistence | isempty(HMC_MOM))
  p = randn(1, nparams);		% Initialise momenta at random
else
  p = HMC_MOM;				% Initialise momenta from stored state
end
lambda = 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;
end

if (display > 0)
  fprintf(1, '\nFraction of samples rejected:  %g\n', ...
    nreject/(nsamples));
end
if 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 later
HMC_MOM = p;
return

% Return complete state of sampler (including momentum)
function state = get_state(f)

global HMC_MOM
state.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_MOM
if 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;
end
return

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品xxxxbbbb| 久久成人麻豆午夜电影| av欧美精品.com| 亚洲欧美一区二区久久| 色综合咪咪久久| 亚洲自拍偷拍欧美| 欧美精选在线播放| 久久精品国产77777蜜臀| 亚洲精品一区二区三区精华液 | 欧美一级午夜免费电影| 美女视频黄久久| 国产色一区二区| 91久久免费观看| 日本va欧美va瓶| 国产精品亲子乱子伦xxxx裸| 日本高清不卡在线观看| 蜜桃久久久久久| 国产精品嫩草久久久久| 欧美性色黄大片| 国产一区中文字幕| 亚洲免费av在线| 日韩欧美你懂的| 波多野结衣的一区二区三区| 亚洲午夜视频在线观看| 久久九九久精品国产免费直播| av激情综合网| 欧美bbbbb| 亚洲欧美中日韩| 91精品国产综合久久久久久漫画 | 亚洲国产精品久久不卡毛片| 欧美xxxxxxxx| 色狠狠桃花综合| 国产在线看一区| 亚洲一本大道在线| 国产婷婷色一区二区三区四区| 欧美三级韩国三级日本一级| 国产精品综合一区二区三区| 亚洲一级片在线观看| 欧美激情一区二区三区不卡| 欧美日韩成人一区| 91在线小视频| 国产精品一二三在| 日本伊人午夜精品| 亚洲视频1区2区| 国产三级精品三级| 7777精品伊人久久久大香线蕉| 粉嫩高潮美女一区二区三区| 免费日本视频一区| 亚洲综合另类小说| 国产精品家庭影院| 久久久综合精品| 日韩美女在线视频| 欧美四级电影在线观看| av激情综合网| 福利一区二区在线观看| 久久国产精品99久久久久久老狼| 亚洲与欧洲av电影| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美大片在线观看| 欧美日韩精品三区| 欧美视频一区在线| 99久久婷婷国产综合精品电影| 国产高清精品网站| 国产自产高清不卡| 久久精品国产亚洲aⅴ| 日韩av在线播放中文字幕| 艳妇臀荡乳欲伦亚洲一区| 国产精品久久久久久久久免费相片 | 欧美一区二区三区四区视频| 99久久免费精品高清特色大片| 国产成人综合亚洲91猫咪| 播五月开心婷婷综合| 亚洲国产一区二区视频| 国产精品久久影院| 日本一区二区三区在线不卡| 久久奇米777| 精品国产亚洲一区二区三区在线观看| 欧美日韩国产美| 欧美色大人视频| 欧美性一级生活| 欧亚洲嫩模精品一区三区| 91视频免费观看| 色哟哟国产精品| 色婷婷综合久久久| 色综合婷婷久久| 欧美最新大片在线看| 在线一区二区三区做爰视频网站| 色视频一区二区| 欧美日韩亚洲综合在线| 宅男在线国产精品| 日韩精品一区二区三区中文精品| 日韩免费电影网站| 国产日产欧美一区| 亚洲欧美在线视频观看| 亚洲精品欧美专区| 午夜精品久久久久久久99樱桃| 婷婷综合五月天| 色欧美日韩亚洲| caoporn国产精品| 色婷婷亚洲综合| 欧美精品三级日韩久久| 欧美变态tickling挠脚心| 久久在线免费观看| 日韩一区欧美一区| 午夜日韩在线电影| 精品一区免费av| 成人国产精品免费网站| 欧美自拍偷拍一区| 日韩欧美国产三级| 国产精品国产三级国产专播品爱网| 一区二区三区中文字幕| 日本欧美一区二区三区| 成人丝袜18视频在线观看| 欧美自拍偷拍午夜视频| 久久综合丝袜日本网| 亚洲色图都市小说| 久久国产福利国产秒拍| 91免费视频网址| 欧美精品一区二区在线播放| 亚洲免费观看高清完整版在线 | 一区二区三区自拍| 蜜桃视频免费观看一区| av在线播放成人| 欧美一级午夜免费电影| 综合欧美亚洲日本| 激情综合色综合久久综合| 99精品国产91久久久久久| 日韩一区二区三区观看| 亚洲天堂a在线| 国产在线一区二区| 欧美日韩精品三区| 日韩一区欧美小说| 国产在线视频精品一区| 欧美人伦禁忌dvd放荡欲情| 中文一区一区三区高中清不卡| 日韩电影一区二区三区四区| 成人动漫一区二区三区| 精品国产伦一区二区三区免费| 亚洲四区在线观看| 国产成人三级在线观看| 51精品秘密在线观看| 亚洲日本va午夜在线影院| 国产在线一区二区| 欧美一区二区视频在线观看2020| 亚洲色图20p| 成人午夜视频在线观看| 久久嫩草精品久久久精品一| 免费在线看成人av| 欧美日韩国产高清一区二区| 中文字幕在线一区免费| 国产毛片一区二区| 日韩欧美国产一区在线观看| 亚洲第一成年网| 欧美亚洲国产一区二区三区 | 一区二区三区成人| 成人av午夜电影| 日本一区二区三区四区在线视频| 国内精品伊人久久久久av一坑| 在线播放欧美女士性生活| 亚洲一区二区在线视频| 色狠狠av一区二区三区| 亚洲男同性恋视频| 91免费国产在线观看| 亚洲另类在线制服丝袜| 色综合网色综合| 一区二区三区在线不卡| 在线亚洲人成电影网站色www| 亚洲视频你懂的| 色婷婷综合久久久中文字幕| 一二三区精品福利视频| 欧美午夜片在线观看| 亚洲成人激情综合网| 欧美日韩成人高清| 日韩电影在线一区| 日韩精品一区二区三区视频播放| 麻豆91精品视频| 久久久亚洲欧洲日产国码αv| 国产不卡在线视频| 中文字幕亚洲不卡| 在线视频你懂得一区| 午夜精品视频在线观看| 日韩一级高清毛片| 国产一区二区伦理片| 国产精品网友自拍| 在线观看亚洲一区| 日本三级亚洲精品| 久久久精品国产99久久精品芒果| 成人一级视频在线观看| 一区二区三区中文在线| 69堂成人精品免费视频| 国产一区二区三区高清播放| 国产精品美女久久久久久久久久久| av在线不卡免费看| 日韩在线一二三区| 久久久国际精品| 在线观看一区不卡| 国产综合色产在线精品| 亚洲免费在线视频| 日韩欧美不卡一区| 99精品欧美一区|