%fga.m 
function [res]=fga(w,x,b,t) 
b=ones(1,size(x,2))*b; 
res=sum(sum(sign((w*x+b).*t')))/length(x); 
flag=isnan(res); 
if(flag==1) 
    res=1; 
end