Commit bf0e913c authored by Simone Butzer's avatar Simone Butzer
Browse files

Changes steplength calculation for L-BFGS

test steplength set to 0.5 aand 1.0
parent 86ced852
......@@ -40,7 +40,7 @@ point_source_(explosive=1;force_in_x=2;in_y=3;in_z=4;custom=5)_(QUELLTYP) = 4
force_angle_between_x_y_(in_degree)_(ALPHA) = 45.0
force_angle_between_x_z_(in_degree)_(BETA) = 45.0
# Plane wave (PW) excitation,if PLANE_WAVE_DEPTH>0, SRCREC is treated as 0
depth_of_PW_excitation_(no<=0)_(in_meter)_(PLANE_WAVE_DEPTH) =
depth_of_PW_excitation_(no<=0)_(in_meter)_(PLANE_WAVE_DEPTH) = 0.0
dip_of_PW_from_vertical_(in_degrees)_(PHI) =0.0
duration_of_source-signal_PW_(in_seconds)_(TS) = 0.0033
# External signal input instead of QUELLART
......@@ -367,7 +367,7 @@ void zero_invers(int NX, int NY, int NZ, float **** Ffvx, float **** Ffvy, float
void precon_grad(int nx,int ny,int nz, float ***grad1, float ***grad2,float ***grad3, int nsrc, float ** srcpos, int ntr_glob, int **recpos, float finv, int iteration,int cdf);
void outgrad(int nx,int ny,int nz,float ***grad1, float ***grad2,float ***grad3, float finv, int iteration, char outfile[STRING_SIZE]);
void outmod(int nx,int ny,int nz,float ***rho, float ***pi,float ***u, int iteration);
void steplength(float *L2, float * step, int iteration);
void steplength(float *L2, float * step, int iteration, int it_group);
void zero_grad(int NX, int NY, int NZ, float *** grad1, float *** grad2, float *** grad3);
void cpmodel(int nx, int ny, int nz, float ***rho, float ***pi, float ***u,float *** testrho, float *** testpi, float *** testu);
void conjugate(int nx,int ny,int nz, float ***grad1, float ***grad2,float ***grad3, float ***gradprior1, float ***gradprior2, float ***gradprior3, float ***gradprior4, float ***gradprior5, float ***gradprior6,float *beta, int iteration,int cdf);
......@@ -1003,13 +1003,9 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
fprintf(FP,"\n STEPLENGTH CALCULATION ITERATION %d \n", iteration);
for (steptest=1;steptest<=2;steptest++){
if(cdf==1) step[4]=0.02;
if(cdf==1) step[4]=TESTSTEP;
step[steptest]=0.0; step[steptest]=step[4]*steptest;
if(iteration>30) step[steptest]=0.005*steptest;
if(iteration>50) step[steptest]=0.003*steptest;*/
if(MYID==0) fprintf(FI,"\n steptest %d: steplength=%e \n",steptest ,step[steptest]);
......@@ -1109,7 +1105,7 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
if(MYID==0)fprintf(FP,"\n\n\n Steplength Parabel \n");
steplength(misfit,step,iteration); /*find optimal steplength*/
steplength(misfit,step,iteration, it_group); /*find optimal steplength*/
if(MYID==0)fprintf(FP,"\n Modelupdate \n");
......@@ -23,16 +23,17 @@
#include "fd.h"
void steplength(float *L2, float *step, int iteration){
void steplength(float *L2, float *step, int iteration, int it_group){
extern FILE *FP;
extern FILE *FI;
extern int MYID;
extern int MYID, LBFGS;
extern float TESTSTEP;
float a=0.0, b=0.0, c=0.0;
float teststep=0.0;
if(MYID==0)fprintf(FP,"Start estimation of optimal steplength\n");
......@@ -60,10 +61,15 @@ void steplength(float *L2, float *step, int iteration){
if(MYID==0)fprintf(FP,"steplength larger stepmax, set to stepmax");
if(LBFGS && it_group>1 && step[3]>1.0){
if(MYID==0)fprintf(FP,"steplength larger 1.0, set to 1.0");
if(MYID==0)fprintf(FP,"steplength smaller 0, set to step[2]");
if(MYID==0)fprintf(FP,"steplength smaller 0, set to %e", step[3]);
if(step[3]<0.1*step[1]){ step[3]=0.1*step[1];
......@@ -79,7 +85,7 @@ void steplength(float *L2, float *step, int iteration){
if(step[4]<0.2*teststep) step[4]=0.2*teststep;
if(step[4]>teststep) step[4]=teststep;
if(LBFGS && it_group>1) step[4]=0.5;
if(MYID==0)fprintf(FI,"new test-steplength4: %e\n", step[4]);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment