NETOUT Simulates network response for a single input
0001 function net = netout(net,x) 0002 % NETOUT Simulates network response for a single input 0003 0004 % Satrajit Ghosh, SpeechLab, Boston University. (c)2001 0005 % $Header: /mnt/localhd/cvsdir/MODELLING/NEWDIVA/@ahrbf/private/netout.m,v 1.1.1.1 2006/10/06 18:20:23 brumberg Exp $ 0006 0007 % $NoKeywords: $ 0008 0009 % get distance matrix 0010 net.c = (x(:,ones(1,net.nhid))-net.mu)./net.sg; 0011 0012 % get basis activation 0013 sumc = sum((net.c).*(net.c)); 0014 ak = exp(-sumc); 0015 net.h = ak/sum(ak); 0016 net.h = reshape(net.h,length(net.h),1); 0017 0018 0019 % get the product wc = net.w*net.c 0020 wc = sum((net.w).*net.c(:,:,ones(1,1,net.nout)),1); 0021 0022 % The first part of the if statement is true only when 0023 % the dimension of wc is [a x 1] or [1 x a] 0024 if prod(size(wc)) == length(wc), 0025 % wc = wc'; % reshape(wc,length(wc,1)); 0026 else, 0027 wc = squeeze(wc)'; 0028 end; 0029 0030 % get output 0031 net.out = (net.v+wc)*net.h;