Changeset 16249


Ignore:
Timestamp:
09/25/13 08:49:05 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: removed gradient_only option, use nsteps=0 instead

Location:
issm/trunk-jpl/src/m
Files:
1 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/classes/inversion.m

    r16246 r16249  
    1919                max_parameters              = NaN
    2020                step_threshold              = NaN
    21                 gradient_only               = 0
    2221                vx_obs                      = NaN
    2322                vy_obs                      = NaN
     
    5049                                                obj.step_threshold              = .99*ones(in.nsteps,1);
    5150                                                obj.vx_obs                      = in.vx_obs;
    52                                                 obj.gradient_only               = 0;
    5351                                                obj.vy_obs                      = in.vy_obs;
    5452                                                obj.vz_obs                      = in.vz_obs;
     
    9593                        obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement.
    9694
    97                         %stop control solution at the gradient computation and return it?
    98                         obj.gradient_only=0;
    99 
    10095                        %cost_function_threshold is a criteria to stop the control methods.
    10196                        %if J[n]-J[n-1]/J[n] < criteria, the control run stops
     
    117112                        md = checkfield(md,'inversion.control_parameters','cell',1,'values',...
    118113                                {'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'DamageDbar' 'Vx' 'Vy' 'Thickness'});
    119                         %md = checkfield(md,'inversion.nsteps','numel',1,'>=',1);
     114                        md = checkfield(md,'inversion.nsteps','numel',1,'>=',0);
    120115                        md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps 1],'>=',0);
    121116                        md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps 1]);
    122117                        md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps num_costfunc],'values',[101:105 201 501:506]);
    123118                        md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
    124                         md = checkfield(md,'inversion.gradient_only','values',[0 1]);
    125119                        md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps num_controls]);
    126120                        md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices num_controls]);
     
    157151                        fielddisplay(obj,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex');
    158152                        fielddisplay(obj,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex');
    159                         fielddisplay(obj,'gradient_only','stop control method solution at gradient');
    160153                        fielddisplay(obj,'vx_obs','observed velocity x component [m/yr]');
    161154                        fielddisplay(obj,'vy_obs','observed velocity y component [m/yr]');
     
    189182                        WriteData(fid,'object',obj,'fieldname','max_parameters','format','DoubleMat','mattype',3);
    190183                        WriteData(fid,'object',obj,'fieldname','step_threshold','format','DoubleMat','mattype',3);
    191                         WriteData(fid,'object',obj,'fieldname','gradient_only','format','Boolean');
    192184                        WriteData(fid,'object',obj,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);
    193185                        WriteData(fid,'object',obj,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);
  • issm/trunk-jpl/src/m/classes/inversion.py

    r16167 r16249  
    2929                self.max_parameters              = float('NaN')
    3030                self.step_threshold              = float('NaN')
    31                 self.gradient_only               = 0
    3231                self.vx_obs                      = float('NaN')
    3332                self.vy_obs                      = float('NaN')
     
    5453                string="%s\n%s"%(string,fielddisplay(self,'min_parameters','absolute minimum acceptable value of the inversed parameter on each vertex'))
    5554                string="%s\n%s"%(string,fielddisplay(self,'max_parameters','absolute maximum acceptable value of the inversed parameter on each vertex'))
    56                 string="%s\n%s"%(string,fielddisplay(self,'gradient_only','stop control method solution at gradient'))
    5755                string="%s\n%s"%(string,fielddisplay(self,'vx_obs','observed velocity x component [m/yr]'))
    5856                string="%s\n%s"%(string,fielddisplay(self,'vy_obs','observed velocity y component [m/yr]'))
     
    102100                self.step_threshold=.7*numpy.ones(self.nsteps) #30 per cent decrement
    103101
    104                 #stop control solution at the gradient computation and return it?
    105                 self.gradient_only=0
    106 
    107102                #cost_function_threshold is a criteria to stop the control methods.
    108103                #if J[n]-J[n-1]/J[n] < criteria, the control run stops
     
    125120                md = checkfield(md,'inversion.incomplete_adjoint','values',[0,1])
    126121                md = checkfield(md,'inversion.control_parameters','cell',1,'values',['BalancethicknessThickeningRate','FrictionCoefficient','MaterialsRheologyBbar','DamageDbar','Vx','Vy'])
    127                 md = checkfield(md,'inversion.nsteps','numel',[1],'>=',1)
     122                md = checkfield(md,'inversion.nsteps','numel',[1],'>=',0)
    128123                md = checkfield(md,'inversion.maxiter_per_step','size',[md.inversion.nsteps],'>=',0)
    129124                md = checkfield(md,'inversion.step_threshold','size',[md.inversion.nsteps])
    130125                md = checkfield(md,'inversion.cost_functions','size',[md.inversion.nsteps,num_costfunc],'values',[101,102,103,104,105,201,501,502,503,504,505])
    131126                md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices,num_costfunc],'>=',0)
    132                 md = checkfield(md,'inversion.gradient_only','values',[0,1])
    133127                md = checkfield(md,'inversion.gradient_scaling','size',[md.inversion.nsteps,num_controls])
    134128                md = checkfield(md,'inversion.min_parameters','size',[md.mesh.numberofvertices,num_controls])
     
    165159                WriteData(fid,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3)
    166160                WriteData(fid,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3)
    167                 WriteData(fid,'object',self,'fieldname','gradient_only','format','Boolean')
    168161                WriteData(fid,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)
    169162                WriteData(fid,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)
  • issm/trunk-jpl/src/m/classes/taoinversion.m

    r16246 r16249  
    7575                        md = checkfield(md,'inversion.control_parameters','cell',1,'values',...
    7676                                {'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'MaterialsRheologyZbar' 'Vx' 'Vy' 'Thickness'});
    77                         %md = checkfield(md,'inversion.nsteps','numel',1,'>=',1);
     77                        md = checkfield(md,'inversion.nsteps','numel',1,'>=',0);
    7878                        md = checkfield(md,'inversion.cost_functions','size',[1 num_costfunc],'values',[101:105 201 501:506]);
    7979                        md = checkfield(md,'inversion.cost_functions_coefficients','size',[md.mesh.numberofvertices num_costfunc],'>=',0);
  • issm/trunk-jpl/src/m/enum/EnumDefinitions.py

    r16243 r16249  
    127127def InversionCostFunctionsCoefficientsEnum(): return StringToEnum("InversionCostFunctionsCoefficients")[0]
    128128def InversionCostFunctionsEnum(): return StringToEnum("InversionCostFunctions")[0]
    129 def InversionGradientOnlyEnum(): return StringToEnum("InversionGradientOnly")[0]
    130129def InversionGradientScalingEnum(): return StringToEnum("InversionGradientScaling")[0]
    131130def InversionIscontrolEnum(): return StringToEnum("InversionIscontrol")[0]
Note: See TracChangeset for help on using the changeset viewer.