deepextractor.utils.io

Module Contents

deepextractor.utils.io.logger[source]
deepextractor.utils.io.get_loaders(train_dir, train_target_dir, val_dir, val_target_dir, batch_size, train_transform=False, val_transform=False, num_workers=4, pin_memory=True, time_domain=True)[source]

Return train and validation DataLoaders.

deepextractor.utils.io.check_accuracy(loader, model, model_name, device='cuda')[source]

Compute MSE loss on the validation set and return average losses.

deepextractor.utils.io.numpy_to_gwf(strain, sample_times, channel, output_filename)[source]

Write a strain time series to a GWF (frame) file.

Parameters:
  • strain (array-like) – The time-domain strain data.

  • sample_times (array-like) – The corresponding time array.

  • channel (str) – Channel name, e.g. 'L1:STRAIN'.

  • output_filename (str) – Path for the output GWF file.

deepextractor.utils.io.gwf_to_lcf(start_time, duration, channel_name, gwf_file_location)[source]

Write a minimal LCF (frame cache) file alongside the GWF file.

deepextractor.utils.io.load_tf_model(path, model_name)[source]

Load a TensorFlow/Keras SavedModel.

Requires the [generative] optional dependencies: pip install deepextractor[generative].