Changeset 4


Ignore:
Timestamp:
08/12/09 16:55:14 (15 years ago)
Author:
pinsard
Message:

dealing with CR/LF and encoding

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/private/make_image_sw.m

    r2 r4  
    1313Tau_interp=interp2(Lat0,Lon0,Tau,Lat,Lon,'nearest'); 
    1414 
    15 %mise au format des autres donnï¿œes 
     15%mise au format des autres données 
    1616load([indir 'Valid_Pixels_251.dat']); 
    1717Tau_1d=nan*ones(size(Valid_Pixels_251)); 
  • trunk/toolbox/MLPfit.m

    r2 r4  
    460460        %%plotplot(Xa,MLPval(Xa,w1,w2,F1,F2),'b-',X,Yb,'r-') 
    461461        %plot(Xa,MLPval(Xa,w1,w2,F1,F2),'b-') 
    462         %S=sprintf('en rouge fonction utilisŽe pour simuler les donnŽes en bleu courbe apprise par le MLP'); 
     462        %S=sprintf('en rouge fonction utilisée pour simuler les données en bleu courbe apprise par le MLP'); 
    463463        %title(S); 
    464464       
  • trunk/toolbox/MLPval.m

    r2 r4  
    11function [Y]=MLPval(x,W1,W2,F1,F2) 
    2  
    32%MLPval compute output values from a trained MLP 
    4  
    53% 
    6  
    74%      [Y]=MLPval(X,W1,W2,F1,F2) 
    8  
    95% 
    10  
    116% X  is the input data 
    12  
    137% W1 the weight matrix input -> hidden layer 
    14  
    158% W2 weight matrix hidden layer -> ouput 
    16  
    179% F1 (default 'tah') activation function of the hidden layer units 
    18  
    1910% F2 (default 'lin') activation function of the output layer units 
    20  
    2111% 
    22  
    2312% Y the output ouf the network at point X 
    24  
    2513%        
    26  
    2714%       21/04/97 S. Canu 
    28  
    29  
    30  
    3115if nargin < 3; 
    32  
    3316   help MLPval 
    34  
    3517   error(sprintf('\n *** MLPval error: invalid call***\n\n\t[Y]=MLPval(X,W1,W2,F1,F2);\n\n')); 
    36  
    3718end; 
    38  
    39  
    40  
    4119% Check that matrix (X) and matrix (W1) have compatible dimensions 
    42  
    43  
    44  
    4520[n,d] = size(x); 
    46  
    4721[dp1,m] = size(W1); 
    48  
    4922[mp1,q] = size(W2); 
    50  
    5123if (d+1)~=dp1, 
    52  
    5324    error('The number of colum in x plus one must equal the number of rows in W1'); 
    54  
    5525end 
    56  
    5726if (m+1)~=mp1, 
    58  
    5927    error('The number of colum in W1 plus one must equal the number of rows in W2'); 
    60  
    6128end 
    62  
    63  
    64  
    6529% Complete unspecified name of activation function 
    66  
    67  
    68  
    6930if nargin < 5; 
    70  
    7131   F2='lin'; 
    72  
    7332   if nargin < 4; 
    74  
    7533      F1 ='tah'; 
    76  
    7734   end; 
    78  
    7935end; 
    80  
    81  
    82  
    83  
    84  
    8536if F1=='tah' & F2=='lin' 
    86  
    8737  a1 = [x ones(n,1)]*W1; 
    88  
    8938  x1 = tanh(a1); 
    90  
    9139  a2 = [x1 ones(n,1)]*W2; 
    92  
    9340  Y =  a2; 
    94  
    95  
    96  
    9741elseif F1=='sig' & F2=='lin' 
    98  
    9942  a1 = [x ones(n,1)]*W1; 
    100  
    10143  x1 = tanh(a1); 
    102  
    10344  a2 = [x1 ones(n,1)]*W2; 
    104  
    10545  Y =  a2; 
    106  
    107  
    108  
    10946elseif F1=='tah' & F2=='tah' 
    110  
    11147  a1 = [x ones(n,1)]*W1; 
    112  
    11348  x1 = phi(a1); 
    114  
    11549  a2 = [x1 ones(n,1)]*W2; 
    116  
    11750  Y =  tanh(a2); 
    118  
    119  
    120  
    12151elseif F1=='sig' & F2=='tah' 
    122  
    12352  a1 = [x ones(n,1)]*W1; 
    124  
    12553  x1 = phi(a1); 
    126  
    12754  a2 = [x1 ones(n,1)]*W2; 
    128  
    12955  Y =  tanh(a2); 
    130  
    131  
    132  
    13356elseif F1=='tah' & F2=='sig' 
    134  
    13557  a1 = [x ones(n,1)]*W1; 
    136  
    13758  x1 = tanh(a1); 
    138  
    13959  a2 = [x1 ones(n,1)]*W2; 
    140  
    14160  Y =  phi(a2); 
    142  
    143  
    144  
    14561elseif F1=='sig' & F2=='sig' 
    146  
    14762  a1 = [x ones(n,1)]*W1; 
    148  
    14963  x1 = phi(a1); 
    150  
    15164  a2 = [x1 ones(n,1)]*W2; 
    152  
    15365  Y =  phi(a2); 
    15466   
    15567   
    15668elseif F1=='tah' & F2=='exp' 
    157  
    15869  a1 = [x ones(n,1)]*W1; 
    159  
    16070  x1 = tanh(a1); 
    161  
    16271  a2 = [x1 ones(n,1)]*W2; 
    163  
    16472  Y =  exp(a2); 
    165  
    166  
    167  
    16873elseif F1=='sig' & F2=='exp' 
    169  
    17074  a1 = [x ones(n,1)]*W1; 
    171  
    17275  x1 = phi(a1); 
    173  
    17476  a2 = [x1 ones(n,1)]*W2; 
    175  
    17677  Y =  exp(a2); 
    177  
    178  
    17978else 
    180  
    18179 error('The name of the activation function is incorect') 
    182  
    18380end 
    184  
    185  
    186  
    187  
    188  
  • trunk/toolbox/cenred.m

    r2 r4  
    11function [X,moya,ecaa] = cenred(Z,moya,eca) 
    2  
    32% Fonction qui centree par moya et eca  
    43%avec la formule X=(2/3)*(Z-moya)/eca 
    54%les invivudus etant en ligne 
    6  
    7  
    8  
    95UN = ones(size(Z)); 
    10  
    116Moy =moya ; 
    127Std =eca; 
    138%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
    14  
    15  
    169Moy = diag(Moy); 
    17  
    1810Moy = UN * Moy; 
    19  
    20  
    21  
    2211taille=size(Z,1); 
    23  
    2412Ecart_type = diag(sqrt((taille-1)/taille)*Std); 
    25  
    2613Ecart_type = UN * Ecart_type; 
    27  
    2814  
    2915  
    30  
    31  
    32  
    33  
    34 % Calcul de la matrice X des donnï¿œes centrï¿œes rï¿œduites 
    35  
     16% Calcul de la matrice X des données centrées réduites 
    3617X = (2/3).*(Z - Moy)./Ecart_type ; 
    37  
    38  
    39  
  • trunk/toolbox/decenred.m

    r2 r4  
    11function X = decenred(Z,moya,ecaa) 
    2  
    32% Fonction pour denormaliser la matrice Z 
    4  
    5  
    63% en lignes 
    74%load moya;load ecaa 
    8  
    95UN = ones(size(Z)); 
    106Moy = moya; 
    117Moy = diag(Moy); 
    128Moy = UN * Moy; 
    13  
    149taille=size(Z,1); 
    15  
    1610Ecart_type = diag(sqrt((taille-1)/taille)*ecaa); 
    1711Ecart_type = UN * Ecart_type; 
    18  
    1912  
    20 % Calcul de la matrice X des donnï¿œes centrï¿œes rï¿œduites 
    21  
     13% Calcul de la matrice X des données centrées réduites 
    2214X = (3./2.)* Z .*Ecart_type + Moy; 
    23  
    24  
    25  
Note: See TracChangeset for help on using the changeset viewer.