资源简介
TSVM算法的完整代码,对于TSVM模型想要尝试一下的,可以下载。
代码片段和文件信息
function errstring = consist(model type inputs outputs)
%CONSIST Check that arguments are consistent.
%
%Description
%
%ERRSTRING = CONSIST(NET TYPE INPUTS) takes a network data structure
%NET together with a string TYPE containing the correct network type
%a matrix INPUTS of input vectors and checks that the data structure
%is consistent with the other arguments. An empty string is returned
%if there is no error otherwise the string contains the relevant
%error message. If the TYPE string is empty then any type of network
%is allowed.
%
%ERRSTRING = CONSIST(NET TYPE) takes a network data structure NET
%together with a string TYPE containing the correct network type and
%checks that the two types match.
%
%ERRSTRING = CONSIST(NET TYPE INPUTS OUTPUTS) also checks that the
%network has the correct number of outputs and that the number of
%patterns in the INPUTS and OUTPUTS is the same. The fields in NET
%that are used are
% type
% nin
% nout
%
%See also
%MLPFWD
%
%Copyright (c) Ian T Nabney (1996-2001)
% Assume that all is OK as default
errstring = ‘‘;
% If type string is not empty
if ~isempty(type)
% First check that model has type field
if ~isfield(model ‘type‘)
errstring = ‘Data structure does not contain type field‘;
return
end
% Check that model has the correct type
s = model.type;
if ~strcmp(s type)
errstring = [‘Model type ‘‘‘ s ‘‘‘ does not match expected type ‘‘‘...
type ‘‘‘‘];
return
end
end
% If inputs are present check that they have correct dimension
if nargin > 2
if ~isfield(model ‘nin‘)
errstring = ‘Data structure does not contain nin field‘;
return
end
data_nin = size(inputs 2);
if model.nin ~= data_nin
errstring = [‘Dimension of inputs ‘ num2str(data_nin) ...
‘ does not match number of model inputs ‘ num2str(model.nin)];
return
end
end
% If outputs are present check that they have correct dimension
if nargin > 3
if ~isfield(model ‘nout‘)
errstring = ‘Data structure does not conatin nout field‘;
return
end
data_nout = size(outputs 2);
if model.nout ~= data_nout
errstring = [‘Dimension of outputs ‘ num2str(data_nout) ...
‘ does not match number of model outputs ‘ num2str(model.nout)];
return
end
% Also check that number of data points in inputs and outputs is the same
num_in = size(inputs 1);
num_out = size(outputs 1);
if num_in ~= num_out
errstring = [‘Number of input patterns ‘ num2str(num_in) ...
‘ does not match number of output patterns ‘ num2str(num_out)];
return
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-10-13 21:49 tsvm\
文件 2674 2015-09-08 21:57 tsvm\consist.m
文件 1640 2015-09-08 21:56 tsvm\contents.m
文件 3670 2015-09-25 20:49 tsvm\demsvml1.m
目录 0 2015-09-26 13:21 tsvm\example1\
文件 662839 2015-09-26 10:22 tsvm\example1\model
文件 660834 2015-09-26 10:23 tsvm\example1\model1
文件 7059 2015-09-26 10:22 tsvm\example1\predictions
文件 536475 1997-11-17 18:11 tsvm\example1\test.dat
文件 2154343 1997-11-17 18:12 tsvm\example1\train.dat
文件 69569 1997-11-21 18:12 tsvm\example1\words
目录 0 2015-09-26 13:21 tsvm\example2\
文件 244433 2015-09-23 19:30 tsvm\example2\model
文件 244001 2015-09-26 10:22 tsvm\example2\model1
文件 549515 2015-09-23 22:06 tsvm\example2\model1.traindata
文件 6926 2015-09-26 10:22 tsvm\example2\predictions
文件 536475 1999-07-06 15:45 tsvm\example2\test.dat
文件 10666 1999-07-19 21:23 tsvm\example2\train_induction.dat
文件 546368 2015-09-23 19:40 tsvm\example2\train_transduction.dat
文件 17128 2015-09-26 10:22 tsvm\example2\trans_predictions
文件 69569 1999-07-06 15:45 tsvm\example2\words
目录 0 2015-09-26 13:21 tsvm\example3\
文件 124 2002-07-03 05:03 tsvm\example3\test.dat
文件 405 2002-07-03 05:01 tsvm\example3\train.dat
文件 5498 2015-09-08 22:14 tsvm\svml.m
文件 1694 2015-09-24 11:46 tsvm\svmlfwd.m
文件 11320 2015-09-08 23:02 tsvm\svmlopt.m
文件 2765 2015-09-26 11:39 tsvm\svmlread.m
文件 2844 2015-09-25 10:54 tsvm\svmltrain.m
文件 2180 2015-09-26 11:39 tsvm\svmlwrite.m
文件 32306 2015-09-08 14:31 tsvm\svm_classify.exe
............此处省略17个文件信息
- 上一篇:cip 报文 工控协议分析
- 下一篇:卡西欧fx96000计算器模拟器
评论
共有 条评论