function pt_scratch3 %save LEOEX M MU U w load LEOEX keyboard return function [U,w,MU,b] = add_feature(U,w,MU,M,x) xi = embedX(x,MU); yh = sign(xi*w); yt = b2y(run_dfsa(M,x)); b = (yh == yt); if ~b % signs disagree N = length(U)+1; U{N,1} = x; %fprintf('processing x = %s \n',x); %MU{N,1} = bool2fsa_pt(['(' x ')'],M.ALF); MU{N,1} = shuf2dfsa(x,M.ALF); w(N,1) = yt * (1+abs(xi*w)); %w(N,1) = yt * (1+sum(abs(w))); end return