你已经派生过 gpr-sidl-inv
镜像自地址
https://gitee.com/sduem/gpr-sidl-inv.git
已同步 2025-08-02 18:36:51 +08:00
113 行
5.4 KiB
Python
113 行
5.4 KiB
Python
# config.py
|
|
import os
|
|
|
|
class Path_Config:
|
|
|
|
#path related to dataset
|
|
path = os.getcwd()
|
|
in_data_dir=path+ '/dataset/in_data/'
|
|
out_data_dir=path+ '/dataset/out_data/'
|
|
INPUT_DATA_FOLDER = './dataset/out_data/'
|
|
INPUT_LABEL_FOLDER = './dataset/eps_label_in_time/'
|
|
dataset_path="./dataset/data.csv"
|
|
labelset_path="./dataset/label.csv"
|
|
|
|
#path related to field data and inversion result
|
|
test_file_name='1350HENGDUANMIAN.DZT'
|
|
TEST_FILE = './field_data/'+test_file_name
|
|
CONVERTED_TEST_FILE=TEST_FILE[:-4]+'_RAW.csv'
|
|
CONVERTED_TEST_FILE_img='./IMG/'+test_file_name[:-4]+'_RAW.png'
|
|
PROCESSED_TEST_FILE='./field_data/'+test_file_name[:-4]+'_PROCESSED.csv'
|
|
PROCESSED_TEST_FILE_img= './IMG/'+test_file_name[:-4]+'_PROCESSED.png'
|
|
inversion_time_result_file='./time_result_csv/'+test_file_name[:-4]+'_time_result.csv'
|
|
inversion_time_result_img= './IMG/'+test_file_name[:-4]+'_time_result.png'
|
|
inversion_depth_result_img= './IMG/'+test_file_name[:-4]+'_depth_result.png'
|
|
|
|
#path related to training
|
|
field_impulse='./impulse/reflection_impulse_field_standard.csv'
|
|
sim_impulse='./impulse/impulse_simulated_standard.csv'
|
|
train_val_loss='./SAVE/train_val_loss.csv'
|
|
LATEST_MODEL_PATH = 'SAVE/latest_model.pt'
|
|
BEST_MODEL_PATH= 'SAVE/best_model.pt'
|
|
|
|
|
|
|
|
class Forward_Model_Config:
|
|
|
|
# parameters about forward modeling for dataset
|
|
model_num=5 # Number of models
|
|
depth=8 # Model depth unit:M
|
|
air_depth=0.5 # Air layer thickness, unit:M
|
|
grid_length=0.02 # grid length
|
|
surface_width=3 # surface width:M
|
|
layers_range=[2,7] # layers range
|
|
smooth_cell=12 # Model smoothing parameters
|
|
min_layer_thickness=0.02 # <=grid length
|
|
first_layer_minlenth=0.8 # first layer minlenth
|
|
first_layer_maxlenth=3.5 # first layer maxlenth
|
|
permittivity_range=(3,30) # the range of permittivity
|
|
first_layer_eps_range=(8,30) # the range of permittivity of first layer
|
|
max_permittivity=30 # the max permittivity
|
|
Time=200e-9 # Collection time window (within the medium)
|
|
static_time=9e-9 # Collection time window (in the air)
|
|
frequency=0.7e8 # Antenna central frequency
|
|
Twindows=Time+static_time # total time
|
|
data_per_ns=10 # Sampling rate per nanosecond
|
|
direct_wave_time=35e-9 # Direct wave duration (ns)
|
|
data_length=1000 # Target length after interpolation (unit: grid number)
|
|
filter_threthold=0.0015 # Minimum absolute value threshold for valid data
|
|
root = os.getcwd() # file path
|
|
|
|
|
|
class Field_data_test_Config:
|
|
|
|
# parameters about field data
|
|
distance=100 # unit: m
|
|
time_window=200 # unit: ns
|
|
extract_time_grid=317 # Extracted time range (grid size)
|
|
bad_trace=[3900,3901] # bad trace range
|
|
detection_distance=1000 # unit: grid
|
|
time_window_length=Forward_Model_Config.data_length # unit: grid
|
|
refer_wave_idx=920 # Reference trace index
|
|
wavelet_range=[215,325] # Reference trace location
|
|
static_time=wavelet_range[0]
|
|
|
|
|
|
class Network_train_Config:
|
|
BATCH_SIZE = 10 # batch size of training
|
|
LR = 0.001 # learning rate
|
|
EPOCHS = 60 # max training epoch
|
|
val_loss_min = 50 # val_loss_min
|
|
network_layers=[8, 8, 8, 8] # network layers
|
|
lr_decrease_rate=0.9 # learning rate decrease rate
|
|
dataset_Proportion=0.9 # Proportion of training set
|
|
save_period=10 # Save interval (unit: epoch)
|
|
num_workers=0 # num_workers
|
|
noise_coff=0.03 # Add intensity of noise
|
|
shift_distance=53 # Convolutional correction distance (unit: grid)
|
|
max_permittivity=Forward_Model_Config.max_permittivity
|
|
data_length=Forward_Model_Config.data_length
|
|
|
|
class Network_prediction_Config:
|
|
|
|
|
|
initial_params = ([21, 21, 21, 21, 21], [200, 200, 200, 200, 200]) #Set initial layered model
|
|
#example: initial_params = ([layer1_permittivity, layer2_permittivity, ...], [layer1_thickness, layer2_thickness, ...])
|
|
smooth_window_size = 20
|
|
######
|
|
######
|
|
######
|
|
num_workers= Network_train_Config.num_workers
|
|
dz_interval=Forward_Model_Config.grid_length
|
|
network_layers=Network_train_Config.network_layers
|
|
max_permittvity=Forward_Model_Config.max_permittivity
|
|
num_workers=Network_train_Config.num_workers
|
|
dt=Forward_Model_Config.Time/Forward_Model_Config.data_length
|
|
max_samples=Forward_Model_Config.data_length
|
|
distance=Field_data_test_Config.distance
|
|
time_window=Field_data_test_Config.time_window
|
|
BATCH_SIZE = 1
|
|
|
|
|
|
|