Configuration Parameters for FWI Scripts
When running the Seistorch FWI scripts, such as fwi.py, seistorch_dist.py and codingfwi.py, you may need to configure additional parameters to tailor the simulations and inversions to your specific requirements. This section provides an overview of these essential configuration parameters and their roles in achieving successful FWI experiments.
Parameters for seistorch_dist.py
Parameter: [config]
Description: Configuration file for geometry, training, and data preparation.
Example Usage:
config.yml
Parameter: [num_threads] (Not supported now)
Description: Sets the number of threads used for intraop parallelism on CPU (torch).
Example Usage:
--num_threads 6will use 6 threads for paralleism.
Parameter: [opt]
Description: Sepcify the optimizer for updating the model parameters.
Example Usage:
--opt adamwill use Adam optimizer for updating the model parameters.Note: Only support Adam(
adam), Steepest Descent(sd), Conjugate gradient(cg) optimizers.
Parameter: [loss]
Description: Sepcify the loss function for fitting the observed and synthetic data.
Example Usage:
--loss vp=l2will use MSE loss for inverting vp. Only support single loss function.
Parameter: [lr]
Description: Sepcify the learning rate for different model parameters.
Example Usage:
--lr vp=10.0will assign the initial learning rate of vp to10.0. This argument also supports multiple assignments, just as follows--lr vp=10.0 vs=5.78 rho=1.25.
Parameter: [grad-cut]
Description: Whether use mask to modify the gradient or not.
Example Usage:
--grad-cutwill mask the gradient by the parameterseabedin configure file.
Parameter: [grad-smooth]
Description: Whether smooth the gradient or not.
Example Usage:
--grad-smoothwill smooth the gradient by the parameterssmoothin configure file.
Parameter: [grad-clip]
Description: Whether clip the gradient or not.
Example Usage:
--grad-clipwill clip the gradient by the parameterclipvaluein sh file.
Parameter: [clipvalue]
Description: The value for clipping the gradient.
Default: 0.02.
Example Usage:
--clipvalue 0.02will first calculate the q-th percentile of the gradient, and then clip the gradient by the value.
Parameter: [step-per-epoch]
Description: The number of steps per epoch.
Default: 1.
Example Usage:
--step-per-epoch 1will update the model parameters once per loss backpropagation.
Parameter: [filteratfirst]
Description: Whether filter the wavelet before modeling.
Example Usage:
--filteratfirstwill filter the wavelet before modeling.
Parameter: [obsnofilter]
Description: Whether filter the observed data.
Example Usage:
--obsnofilterwill not filter the observed data.
Parameters for fwi.py
Parameter: [config]
Description: Configuration file for geometry, training, and data preparation.
Example Usage:
config.yml
Parameter: [num_threads]
Description: Sets the number of threads used for intraop parallelism on CPU (torch).
Example Usage:
--num_threads 6will use 6 threads for paralleism.
Parameter: [num-batches]
Description: How many batches the data will be seperated. Seistorch will perform modeling
ceil(num-shots/num-batches)times.Example Usage:
--num-batches 1: All the data will be bundled in a single batch.
Parameter: [save-path]
Description: Sepcify the path for saving the inverted results.
Example Usage: The arguments will overwrite the parameter
inv_savePathin configure file. If not specified, the results will be saved ininv_savePath.
Parameter: [loss]
Description: Sepcify the loss function for fitting the observed and synthetic data.
Example Usage:
--loss vp=l2will use MSE loss for inverting vp. Only support single loss function.
Parameter: [lr]
Description: Sepcify the learning rate for different model parameters.
Example Usage:
--lr vp=10.0will assign the initial learning rate of vp to10.0. This argument also supports multiple assignments, just as follows--lr vp=10.0 vs=5.78 rho=1.25.
Parameter: [mode]
Description: Sepcify the mode of the module.
Example Usage: Valid modes are
forwardandinversion.
Parameter: [grad-cut]
Description: Whether use mask to modify the gradient or not.
Example Usage:
--grad-cutwill mask the gradient by the parameterseabedin configure file.
Parameters for codingfwi.py
Parameter: [config]
Description: Configuration file for geometry, training, and data preparation.
Example Usage:
config.yml
Parameter: [num_threads]
Description: Sets the number of threads used for intraop parallelism on CPU (torch).
Example Usage:
--num_threads 6will use 6 threads for paralleism.
Parameter: [use-cuda]
Description: Use CUDA for acceelrating computations
Example Usage:
--use-cudawill assign the tasks on GPU.
Parameter: [gpuid]
Description: Sepcify the GPU id for using.
Example Usage:
--gpuid 0will assign the task on GPU 0.
Parameter: [loss]
Description: Sepcify the loss function for fitting the observed and synthetic data.
Example Usage:
--loss vp=l2will use MSE loss for inverting vp. If you want to use different loss function for different paramters, you can specify the arguments like this--loss vp=l2 vs=l1. Valid loss functions can be found inseistorch/loss.py
Parameter: [save-path]
Description: Sepcify the path for saving the inverted results.
Example Usage: The arguments will overwrite the parameter
inv_savePathin configure file. If not specified, the results will be saved ininv_savePath.
Parameter: [lr]
Description: Sepcify the learning rate for different model parameters.
Example Usage:
--lr vp=10.0will assign the initial learning rate of vp to10.0. This argument also supports multiple assignments, just as follows--lr vp=10.0 vs=5.78 rho=1.25.
Parameter: [batchsize]
Description: Sepcify the number of shots encoded in a super source.
Example Usage:
--batchsize 20will encoded 20 shots in a super source.
Parameter: [grad-smooth]
Description: Whether smooth the gradient or not.
Example Usage:
--grad-smoothwill smooth the gradient before callingoptimizer.step().
Parameter: [grad-cut]
Description: Whether use mask to modify the gradient or not.
Example Usage:
--grad-cutwill smooth the gradient by the parameterseabedin configure file.