Predict

first_break_picking.train_eval.ai_tools

first_break_picking.train_eval.ai_tools.load_checkpoint(model, file: str, device: str) None

Load checkpoint for selected model

Parameters:
  • model – A DL network

  • file (str) – Checkpoint’s file

  • device (str) – Name of device

first_break_picking.train_eval.ai_tools.save_checkpoint(model, file: str) None

saves the checkpoints

Parameters:
  • model – _description_

  • file (str) – _description_

first_break_picking.train_eval.predict module

first_break_picking.train_eval.predict.predict(base_dir: str, path_to_save: str, upsampled_size_row: int, upsampled_size_col: int, x_axis: ndarray = None, y_axis: ndarray = None, split_nt: int = 0, overlap: float = 0.0, original_dispersion_size: Tuple = (157, 490), dt: float = 1, data_info: DataFrame = None, checkpoint_path: str = None, model_name: str = 'unet_resnet', smoothing_threshold: int = 50, features: List[int] = [16, 32, 64, 128], in_channels: int = 1, out_channels: int = 2, validation: str = False, save_list: List[str] = None, save_segmentation: bool = False)

This function is to be called to predict the results.

Parameters:
  • base_dir (str) – Directory where datasets (*.npy) are saved

  • split_nt (int) – Number of traces in splitted shot (for example 17)

  • overlap (float) – Overlap betwwen each shot for spliting

  • n_time_sampels (int) – Number of time samples in each shot

  • width_enlarged_subshot (int) – Number of traces in upsampled shot (devisable by 16)

  • dt (float) – Temporal sampling rate

  • data_info (pd.DataFrame,) – A dataframe containing name of each shot (FFID) and its number of traces and subshots

  • checkpoint_path (str, optional) – Path to the checkpoints. If not specified, it uses a pre-trained model

  • model_name (str, optional) – Name of the network, by default “unet_resnet” It can be either ‘unet’ or ‘unet_resnet’

  • smoothing_threshold (int, optoional) – In each trace, if there is there is multiple segment in smoothing_threshold, model does picks the first occurance of the data segment as anomaly and moves to the next occurance of data segment.

  • features (List[int], optional) – List of number of channels for each conv layer, by default [16, 32, 64, 128]

  • n_channels (int, optional) – Number of channels in the input shot, by default 1

  • out_channels (int, optional) – Number of out-channels , by default 2

  • validation (bool, optional) – Specify it is validation set (with label) or the dataset is without label, by default False

  • save_list (List[str], optional) – List of FFIDs to save

  • save_segmentation (bool, optional) – Specify if user desires to save the segmentation, by default False