COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Elliptical Basis Function NN Design #2

• Email
• Follow

```% 1. Create the 6 trn/val/tst input/target subsets
% 2. For a c-class classifier, the columns of the target matrices
%    are all columns of the c-dimensional unit matrix eye(c) with
%    the single 1 indicating the corresponding class. Inputs will
%    be assigned to the class coresponding to the largest output.
% 3. Standardize (e.g., mapstd) the trn input and normalize the val
and
%    trn inputs with the means and variances from trn.
% 4. It is sufficient to use a single hidden layer so that the node
%    topology for I-dimensional inputs and O-dimensional outputs
%    is I-H-O (O=c);
% 5. Calculate the trn/val/tst MSEs for the naive constant models.
%    For example,
%    ytrn00          = repmat(mean(ttrn,2),1,Ntrn);
%    MSEtrn00    = mse(ttrn-ytrn00)
%    Neq00         = Ntrn*O                  % No. of equations
%    Nw00          = O                          % No. of weights
%    MSEtrn00a = sse(ttrn-ytrn00)/(Neq00-Nw00)  % MSE "a"djusted to
mitigate the optimistic bias caused by estimating generalization
performance using the same data that was used for weight estimation.
%    etc
% 6. The number of training equations is Neq = Ntrn*O and the number
%    of unknown weights is Nw = (I+1)*H+(H+1)*O. For training to
%    convergence, a necessary criterion for a unique solution is
%    Neq >= Nw or H <= Hub where the upperbound is given by
%    Hub = (Neq-O)/(I+O+1). However, weight estimates are more
%    resistant to noise and measurement errors when H << Hub. The
%    optimal value, Hopt, is usually estimated via trial and error.
% 7. To avoid nonoptimal local min solutions, choose the best of
%    many designs obtained by using multiple random weight
%    intializations for each candidate value of H.
% 8. Determine a search grid for H: (e.g., Hmin:dH:Hmax) and the
%    number of random weight initialization trials, Ntrials, for
%    each H candidate.
% 9. Initialize the RAND generator and create numH*Ntrials candidate
%    designs using an outer loop of length numH = length(Hmin:dH:Hmax)
%    and an inner loop of length Ntrials.
% 10. The canonical Bayesian classification goal is to minimize the
%     total misclassification risk, given class a priori
probabilities
%     and misclassification costs. However, most practical approaches
%     1. Use duplication or simulation of additional samples to
prevent
%        significantly unbalanced class mixtures of training data.
%     2. Minimize the mean-square error of the difference between the
%        output estimates of posterior probability and the target
%        matrices.
%     3. Use the estimates of val set mixture misclassification rate
%        to select the best group of designs.
%     4. Either choose the best design or combine the outputs from
%        a committee of best designs.
%
%   Consider the following demo of an I-H-O Elliptical Basis
Function
%   (EBF) design using NEWFF and RADBAS. The search is over H =
2.^(0:6),
%   Ntrials = 10. The training goal is an adjusted training R^2 of
0.99
%   which is obtained half the time when H = 32 .
%   Modification of the code to include a validation set to choose
the
%   best designs and a test set to estimate performance on unseen
data
%   is left to the reader.

close all, clear all, clc, k=0

N1 = 30, N2 = 30, N3 = 30, N4 = 30
randn('state',4151941)
p1 = repmat([-1;-1],1,N1)+0.6*randn(2,N1);
p2 = repmat([ 1;-1],1,N2)+0.6*randn(2,N2);
p3 = repmat([ 1; 1],1,N3)+0.6*randn(2,N3);
p4 = repmat([-1; 1],1,N4)+0.6*randn(2,N4);

eye4 = eye(4);
t1 = repmat(eye4(:,1),1,N1)
t2 = repmat(eye4(:,2),1,N2)
t3 = repmat(eye4(:,3),1,N3)
t4 = repmat(eye4(:,4),1,N4)

k=k+1,figure(k),hold on
plot(-3:3,zeros(1,7),'k')
plot(zeros(1,7),-3:3,'k')
plot(p1(1,:),p1(2,:),'ko')
plot(p2(1,:),p2(2,:),'ro')
plot(p3(1,:),p3(2,:),'bo')
plot(p4(1,:),p4(2,:),'go')

ptrn = [p1 p2 p3 p4];
ttrn = [t1 t2 t3 t4];
[I Ntrn] = size(ptrn)         % [2 120]
[O Ntrn] = size(ttrn)         % [4 120]
Neq      = Ntrn*O             % 480

MSEtrn00  =  mse(ttrn - repmat(mean(ttrn,2),1,Ntrn)) % 0.1875
MSEtrn00a =  mean(var(ttrn'))                        % 0.1891

%   Nw00      =  O % No. of weights
%   MSEtrn00  =  sse(ttrn - repmat(mean(ttrn,2),1,Ntrn))/Neq        %
0.1875
%   MSEtrn00a =  sse(ttrn - repmat(mean(ttrn,2),1,Ntrn))/(Neq-Nw00) %
0.1891

Hub  = (Neq-O)/(I+O+1)    % 68

Hmin = 16
dH   = 4   % Minimum allowable value is 1
Hmax = 34

Ntrials = 10
rand('state',0)

for i = 1:7   %H = [1 2 4 8 16 32 64]
H = 2^(i-1)
Nw = (I+1)*H+(H+1)*O
for j = 1:Ntrials
net.trainParam.goal   = 0.01*(Neq-Nw)*MSEtrn00/Neq; %R2trna
= 0.99
net.trainParam.show   = inf;
%           net.trainParam.epochs = 500;
[net tr] = train(net,ptrn,ttrn);
Nepochs(j,i) = tr.epoch(end);
MSEtrn       = tr.perf(end);
R2trn(j,i)   = 1 - MSEtrn/MSEtrn00;
R2trna(j,i)  = 1- (Neq/(Neq-Nw))*MSEtrn/MSEtrn00;
%           MSEval       = mse(tval-sim(net,pval));
%           R2val(j,i)   = 1- MSEval/MSEval00;
%           MSEtst       = mse(ttst-sim(net,ptst));
%           R2tst(j,i)   = 1- MSEtst/MSEtst00;
end
end

H = 2.^(0:6)
Nepochs
R2trn
R2trna

H =    1     2     4     8    16    32    64

Nepochs =   60    78    53   500   500   500    58
62    37    41   468   359   500    50
76    49   500   209   500    82    46
91    31    90   155   500   454    56
58    32    82   500   500   198    54
61    31    49   500   500   500    44
30    54    58   145   500   500    52
70    53   500   141   500   237    40
58    56    49   500   500   115    62
61    49   143   239   500   500    56

R2trn = 0.1780    0.5476    0.8271    0.8685    0.9362    0.9932
0.9994
0.2207    0.5696    0.7972    0.8737    0.9304    0.9867
0.9994
0.2930    0.5669    0.7998    0.8784    0.9517    0.9948
0.9994
0.2781    0.5673    0.8131    0.8631    0.9295    0.9948
0.9994
0.1780    0.5669    0.8124    0.8775    0.9383    0.9950
0.9994
0.2752    0.5673    0.8271    0.8576    0.9421    0.9937
0.9994
0.2915    0.5669    0.8310    0.8924    0.9324    0.9853
0.9994
0.1780    0.5649    0.8129    0.8719    0.9291    0.9948
0.9995
0.2207    0.4934    0.7899    0.8817    0.9659    0.9948
0.9994
0.2207    0.5673    0.7992    0.8682    0.9269    0.9713
0.9994

R2trna = 0.1588    0.5300    0.8148    0.8498    0.9158    0.9871
0.9903
0.2024    0.5529    0.7827    0.8557    0.9083    0.9746
0.9902
0.2764    0.5501    0.7855    0.8610    0.9363   *0.9901
0.9900
0.2612    0.5505    0.7998    0.8435    0.9070   *0.9900
0.9904
0.1588    0.5501    0.7990    0.8601    0.9186   *0.9904
0.9901
0.2582    0.5505    0.8148    0.8373    0.9237    0.9881
0.9904
0.2749    0.5501    0.8189    0.8770    0.9109    0.9721
0.9903
0.1588    0.5480    0.7995    0.8536    0.9065   *0.9900
0.9908
0.2024    0.4737    0.7749    0.8649    0.9551   *0.9901
0.9903
0.2024    0.5505    0.7849    0.8494    0.9036    0.9454
0.9903

```
 0
Reply heath (3990) 1/4/2012 3:34:57 PM

See related articles to this posting

0 Replies
45 Views

Similar Articles

12/11/2013 6:45:50 PM
[PageSpeed]

Similar Artilces:

rules for using functions as basis vectors #2
Thanks for the help but I'm hesitant to alter the attributes of Dot. Also, it is not the orderless aspect of Dot that gives me my main difficulty. I do not know how to specify the necessary rules. Here is an updated version of my code. (* here are the rules for dot products between the basis elements *) {t /: t[u_].t[u_] := 1, t /: t[u_].n[u_] := 0, t /: t[u_].b[u_] := 0}; {n /: n[u_].t[u_] := 0, n /: n[u_].n[u_] := 1, n /: n[u_].b[u_] := 0}; {b /: b[u_].t[u_] := 0, b /: b[u_].n[u_] := 0, b /: b[u_].b[u_] := 1}; (* here are the relations between derivatives of the basis elemen...

using 2 diffrent clock rates in a design. #2
Hi friends. how r u all doing, well i have a doubt here. i have to write a tcl script to produce an input from a file at a clock rate "clk1" and then capture the output of the DUT at a diffrent clock rate say "clk2". now i have to give input to DUT at a while loop and then capture at a diffrent loop. i'am facing problem here/ any clues or ideas how to proceed.. plzz reply soon.. thanks bye ...

eval function #2
what does eval function do in javascript language and what are its usages? <amohajer@hotmail.com> wrote in message news:1102918795.967434.167160@z14g2000cwz.googlegroups.com... > what does eval function do in javascript language and what are its > usages? RTFM... http://developer.netscape.com/library/documentation/javascript.html :) -- Dag. On Mon, 13 Dec 2004 07:30:56 GMT, Dag Sunde <me@dagsunde.com> wrote: > <amohajer@hotmail.com> wrote in message > news:1102918795.967434.167160@z14g2000cwz.googlegroups.com... > >> what does eval function d...

jacobi elliptic function
Hello, I am trying to solve 3 nonlinear coupled equations using fsolve. In these equations 'inverse SN(b/m)' is also included as a term....... How to write this inverse Sn value. I know only [SN,CN,DN]=ellipj(u,m)............ Please suggest me in this regard. Thank you. ...

Design Question #2
I'm working with a data set similar to horseracing problem (it's actually a healthcare problem) in which I've got a groups (sets) of 8 proteins. I trying to predict the final order of the proteins, so in many ways it's a horserace type problem. My question is a design one. Is there any way to input the set of protein (vectors) - as a 8x8 matrix but in a way that would enable me to look across the 300+ (8x8) matrixes. I want to be able to identify those that I can successfully predict using non-neural net methods. I've got about a 30% hit rate but if I can go up to aroun...

face function #2
So i have a function in a class Bad_Guy that looks something like this: void face(double a, double b, double c) //represent where i want the bad guy to face { //which will almost always be 0,0,0 } hard huh? Anyway, when i make a bad guy appear at 0,0,-15 the bad guy is already facing 0,0,0 but what if i want to place the bad guy at 4,0,15? I want the bad guy to always face 0,0,0. I suspect it has something to do with using glRotatef() but i don't seem to be able to get that function to do what i want. can someone please help me fill in ...

design question #2
I have a table: questions(question_id, content) I am in the process of creating another table, titled as test, which should map a unique test id to multiple questions. There are two possibilities to create this table: 1. test(test_id, a set of question_ids); the set of questions is stored as a nested table. 2. test(surrogate_key, test_id, question_id) Which alternative is better? Or is there any other alternative that is better than the above two? Thanks vnr1995@gmail.com wrote: > I have a table: questions(question_id, content) > > I am in the process of creating another tabl...

Virtual Functions #2
Hi Group This is mine first postings in this group Can anybody take the pain in explaining me What exactly are Virtual Functions VC++ On 15 Jun 2005 04:05:46 -0700, VCForums@gmail.com wrote: >Hi Group >This is mine first postings in this group > >Can anybody take the pain in explaining me What exactly are Virtual >Functions > > >VC++ Welcome to comp.lang.c++! Have you tried this? http://www.parashift.com/c++-faq-lite/virtual-functions.html -- Bob Hairgrove NoSpamPlease@Home.com Bob Hairgrove wrote: > On 15 Jun 2005 04:05:46 -0700, VCForums@gmail.com wrote: ...

function #2 382291
i can't understand what i've to do... ...

template functions #2
I have made a template function i a .c++ file. But I can't call it from main: template <typename V> void test_stack() { V v; } int main(int, char**) { test_stack()<int>; } I get the error: In function �int main(int, char**)�: error: no matching function for call to �test_stack()� error: expected primary-expression before �int� 7: error: expected `;' before �int� How do I call a template function? On 31 Jan., 23:23, saneman <y...@dd.com> wrote: > I have made a template function i a .c++ file. But I can't call it from > main: > > template <...

template function #2
Hi, I am trying to use template function and encounted some problems hope to get your help. THANKS! make output: undefined reference to `int reallocateMemory<double>(double*&, int)' ( compile of auxifunc.o: OK; link: main.o auxifunc.o ) ( makefile should be ok ) source code below: ================== auxifunc.h template < class T > extern int reallocateMemory( T*& array, int newsize ); ================== auxifunc.cpp template < class T > int reallocateMemory( T*& array, int newsize ) { delete[] array; array = new T[newsize]; if ( !array ) return...

Function prototypes #2
Hi, I'm currently taking a data structures course in C, and my teacher said that function prototypes are not allowed in any of our code. He also said that no professional programmers use function prototypes. This kind of bugged me, because from other people's code that I've seen in the past, almost all of them use function prototypes. The following also bugged me. Let's say you have a file called main.c with only the main function, and includes hello.h, to use functions within hello.c. So hello.h should contain prototypes for the functions in hello.c, so when main.c is compile...

Database design #2
I'm developing a project about little soccer league. I need to store teams, team's players, matches info (which are two teams involved in the match), events (various events happened douring a single match: goal, penalty, red card, yellow card, etc). This is the DB realized (only PK and FK are shown): http://www.freeimgshost.com/viewer.php?file=pi93lbvdrje2iup9cw8.jpg What do you think? Does it seems correct???? Best regards MC Mariano C. wrote: > I'm developing a project about little soccer league. I need to store > teams, team's players, matches info (w...

string function #2
select distinct(f.agency+y.year+s.type) as SDNF In this select clause, I try to use the last 2 digit of year for y.year value. which function should i apply to it? TGEAR (ted_gear@hotmail.com) writes: > select distinct(f.agency+y.year+s.type) as SDNF > > In this select clause, I try to use the last 2 digit of year for y.year > value. which function should i apply to it? substring if year is a string value. There is an entry in Books Online in the T-SQL Reference for "Functions". Looking through that entry may be well spent time. -- Erland Sommarskog, SQL Server MV...

Function PLzzzzzzzzzzz #2
Guys also how would i write a function for converting a decimal no to binary and binary to decimal no a prototype is enough - ash464 ----------------------------------------------------------------------- Posted via http://www.codecomments.co ----------------------------------------------------------------------- ash4640 <ash4640.1bhj5o@mail.codecomments.com> wrote in message news:<ash4640.1bhj5o@mail.codecomments.com>... > Guys also how would i write a function for converting a decimal no to a > binary and binary to decimal no a prototype is enough. here is your prot...

SUM Function #2
I need to attach an Expression to a unbound text box that says..... IIf([Quantity Sold]=0,0,=Sum([Quantity Sold])) is the syntex wrong! But it's not working...basically I have an Unbound Textbox That Sums up the total of Quantity Sold. But If I don't have a record, the field comes up blank all though I still have a number that should go in there, like the starting Inventory. Once I put a record in, it works fine. Thanks DS Try this: =Sum(Nz([Quantity Sold], 0)) -- Ken Snell <MS ACCESS MVP> "DS" <bootybox@optonline.net> wrote in message ne...

training NN #2
Hi, first...i'm new to GA and ANN... I've been working on a project which an ANN is trained with GA. I've already developed an ANN trained with backprop just to test the functionality ad i got fun on that but now with GA i'm stucking with some problems and actually i don't know how to locate them... for example if i test the application with the XOR function i see the error going down beyond the threshold, but when i save the weights of the network and i try to calculate the output and i got a result so far from the correct one. Looking at the code seems everything correct....

Video Games Design #2
AJ Square provides value added services to its clients in developing fantabulous game characters enough to get you started. You will never want to miss us, as we create characters that surpasses your expectation. sources: http://www.ajsquare.com/creative/game_development.php?create=game On Apr 16, 4:03=A0pm, swasa <swasaa...@gmail.com> wrote: > AJ Square provides value added services to its clients in developing > fantabulous game characters enough to get you started. You will never > want to miss us, as we create characters that surpasses your > expectation. > > sour...

Creating a new Function #2
With XST I'm unable to create my own function called "Erics_Gate". If I change the name to "and" or any other exsisting operator it works fine, but I'd like this function to be called "Erics_Gate". Any Ideas on how to define "Erics_Gate" as an operator? library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; use IEEE.NUMERIC_STD.ALL; entity mux is Port ( A, B : in STD_LOGIC; CLK : in STD_LOGIC; Y : out STD_LOGIC); end mux; architecture Behavioral of mux is function "Eric_gate" (L:st...

Designing template function specialization
I'm putting together a templated matrix class for fun and came across the following design issue: I want to specialize the set/get data functions to take advantage of certain types of matrix structure (e.g. the matrix is symmetric or an indentity matrix). Since I'm aiming for speed, it's an absolute requirement that the set/get code be inlined. If I could use an enumerated value as a template parameter, that would solve my problem. I don't think c++ supports that. Another approach would be to use the strategy pattern, and pass in the set/get strategy object as a template p...