run_helix.m

来自「非线型因素分析matlab仿真程序包」· M 代码 · 共 42 行

M
42
字号
%% Example of the use of Nonlinear factor analysis Matlab package%% Copyright (C) 1999-2004 Antti Honkela, Leo Lundqvist, Harri Valpola,% and Xavier Giannakopoulos.%% This package comes with ABSOLUTELY NO WARRANTY; for details% see License.txt in the program package.  This is free software,% and you are welcome to redistribute it under certain conditions;% see License.txt for details.% Generate the data for the helixsrcdim = 1;nsampl = 1000;noisestd = .05;inputs = randn(srcdim, nsampl);data = [cos(pi*inputs); sin(pi*inputs); inputs];data = data + noisestd * randn(size(data));% Visualize itplot3(data(1,:), data(2,:), data(3,:), '.')axis imagedrawnow% Parameters for iterationhidneurons = 15;            % The number of hidden neurons to usesearchsources = 1;          % The number of sources to look foriters = 1000;               % The number of iterations% Do initialization and iterate% (This may take some time...)[res, x] = nlfa(data, 'searchsources', searchsources, ...		'hidneurons', hidneurons, 'iters', iters);% The results are returned in structures res.% The reconstructions of the data are in probdist-matrix x.% The reconstructions can then be plotted to the same picturehold on;plot3(x.e(1,:), x.e(2,:), x.e(3,:), 'r.')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?