Changeset 17 for trunk/private


Ignore:
Timestamp:
08/18/09 17:36:31 (15 years ago)
Author:
pinsard
Message:

script_correc : results on stdout or in output file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/private/script_correc.m

    • Property svn:keywords set to Id
    r16 r17  
    1414% 
    1515% ``script_correc`` plot ans save several figures : 
    16 %  
    17 %  - script_correc_thetas.eps :  
    18 % 
    19 %  - script_correc_thetav.eps :  
    20 % 
    21 %  - script_correc_dphi.eps :  
    22 % 
    23 %  - script_correc_rho_670_.eps :  
    24 % 
    25 %  - script_correc_rho_765_.eps :  
    26 % 
    27 %  - script_correc_rho_865_.eps :  
    28 % 
    29 %  - script_correc_tau.eps :  
    30 % 
    31 %  - script_correc_diagramme_dispersion.eps : 
    32 % 
    33 %  - script_correc_histogramme_erreur.eps : 
     16% 
     17%  - ``script_correc_thetas.eps`` : 
     18% 
     19%  - ``script_correc_thetav.eps`` : 
     20% 
     21%  - ``script_correc_dphi.eps`` : 
     22% 
     23%  - ``script_correc_rho_670_.eps`` : 
     24% 
     25%  - ``script_correc_rho_765_.eps`` : 
     26% 
     27%  - ``script_correc_rho_865_.eps`` : 
     28% 
     29%  - ``script_correc_tau.eps`` : 
     30% 
     31%  - ``script_correc_diagramme_dispersion.eps`` : 
     32% 
     33%  - ``script_correc_histogramme_erreur.eps`` : 
     34% 
     35% If ``fid_log`` is not set, log informations are printed on stdout. 
     36% 
     37% If ``fid_log`` set previous launching ``script_correc`` to more than 1, 
     38% log informations are saved in ``script_correc.log``. 
    3439% 
    3540% EXAMPLES 
    3641% ======== 
     42% 
     43% To run and see log informations on screen : 
    3744% 
    3845% :: 
     
    4350% >> script_correc 
    4451% 
     52% To run and save log informations in ``script_correc.log`` : 
     53% 
     54% :: 
     55% 
     56% >> addpath('../toolbox') 
     57% >> tp_mlp_aerosols_startup 
     58% >> fid_log = 6; 
     59% >> more off 
     60% >> script_correc 
     61% 
     62% 
    4563% SEE ALSO 
    4664% ======== 
     
    6583% Running octave, ``more off`` is compulsary but I don't not yet why 
    6684% 
    67 % save output (sdout and stderr) to make comparisons possible 
     85% save output (stderr) to make comparisons possible 
    6886% 
    6987% If printer is set to png, one might see following warning using octave : 
     
    7492% And no labels are visible on figure outputfiles. 
    7593% 
    76 % For now, find a portable solution (setting GDFONTPATH) is too tough, so  
     94% For now, find a portable solution (setting GDFONTPATH) is too tough, so 
    7795% printer is set to eps. 
    7896% 
     
    8199% 
    82100% $Id$ 
     101% 
     102% - fplod 2009-08-18T14:21:33Z aedon.locean-ipsl.upmc.fr (Darwin) 
     103% 
     104%   * log information either on screen (stdout) or in ``script_correc.log`` 
    83105% 
    84106% - fplod 2009-08-18T09:55:12Z aedon.locean-ipsl.upmc.fr (Darwin) 
     
    104126%NOTE : C'est la partie du TP à modifier car il y a trop de choses à coder. 
    105127 
    106 if ~exist('LUT_NIR') 
    107 load('../LUT/LUT_NIR.dat'); 
     128if ~exist('LUT_NIR','var') 
     129 load('../LUT/LUT_NIR.dat'); 
    108130end 
    109131 
     
    213235script_app 
    214236 
     237% définition du fichier de sortie "Affichage" 
     238% if not set, fid_log is set to 1 (stdout) 
     239if ~ exist('fid_log','var') 
     240 fid_log = 1; 
     241end 
     242 
     243% ouverture du ficher de sortie "Affichage" si différent de stdout 
     244fid_log_is_stdout = isequal(fid_log,1); 
     245 
     246if fid_log_is_stdout == 0 
     247 fullfilename = ['./', mfilename, '.log']; 
     248 fid_log = fopen(fullfilename,'w'); 
     249 clear fullfilename; 
     250end 
     251 
    215252%Affichage du tableau des performances 
    216 fprintf('\n\t\tInit1\t\tInit2\n') 
     253fprintf(fid_log,'\n\t\tInit1\t\tInit2\n'); 
    217254for n=1:length(archi) 
    218 fprintf(1,'%d neurones\t%3.2e\t%3.2e\n',archi(n),perf(n,1),perf(n,2)); 
     255 fprintf(fid_log,'%d neurones\t%3.2e\t%3.2e\n',archi(n),perf(n,1),perf(n,2)); 
    219256end 
    220257 
     
    223260mini=min(perf(:)); 
    224261[n,i]=find(perf==mini); 
    225 fprintf(1,'\n Architecture optimale : %d neurones (RMS=%3.2e)\n',archi(n),perf(n,i)); 
     262fprintf(fid_log,'\n Architecture optimale : %d neurones (RMS=%3.2e)\n',archi(n),perf(n,i)); 
    226263 
    227264%FACULTATIF : On prolonge l'apprentissage avec une base plus grosse 
     
    241278  perf_opti=sqrt((1./length(delta))*sum(delta.^2)); 
    242279 
    243   fprintf(1,'\nRMS finale : %3.2e\n',perf_opti); 
     280  fprintf(fid_log,'\nRMS finale : %3.2e\n',perf_opti); 
     281 
     282  % fermeture du ficher de sortie "Affichage" si différent de stdout 
     283  if fid_log_is_stdout == 0 
     284   fclose(fid_log); 
     285  end 
     286  clear fid_log_is_stdout; 
    244287 
    245288  figure 
Note: See TracChangeset for help on using the changeset viewer.