条件随机场链式CRF
代码说明:
机器学习算法代码,可以用于分词,图像识别,行为识别等 原版本只可以在32位xp下运行,经本人修改,适用于各种版本matlab windows clear all useMex = 0; % Set this to 1 to use mex files to speed things up %% Generate Synthetic Data % Notes: % - X is categorical, each element X(i,j) contains the value of feature j for word i, % a value of "0" means ignore the feature for this training example % - y is cateogircal, each element y(i) contains the label for word i % a value of "0" indicates the position between sentences [X,y] = crfChain_genSynthetic; nWords = size(X,1); nStates = max(y); nFeatures = max(X); %% Initialize parameters and data structures [w,v_start,v_end,v] = crfChain_initWeights(nFeatures,nStates,"randn");%初始化参数为正太分布,w状态-特征,v状态-状态 featureStart = cumsum([1 nFeatu
下载说明:请别用迅雷下载,失败请重下,重下不扣分!