deepextractor.utils.io ====================== .. py:module:: deepextractor.utils.io Module Contents --------------- .. py:data:: logger .. py:function:: 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) Return train and validation DataLoaders. .. py:function:: check_accuracy(loader, model, model_name, device='cuda') Compute MSE loss on the validation set and return average losses. .. py:function:: numpy_to_gwf(strain, sample_times, channel, output_filename) Write a strain time series to a GWF (frame) file. :param strain: The time-domain strain data. :type strain: array-like :param sample_times: The corresponding time array. :type sample_times: array-like :param channel: Channel name, e.g. ``'L1:STRAIN'``. :type channel: str :param output_filename: Path for the output GWF file. :type output_filename: str .. py:function:: gwf_to_lcf(start_time, duration, channel_name, gwf_file_location) Write a minimal LCF (frame cache) file alongside the GWF file. .. py:function:: load_tf_model(path, model_name) Load a TensorFlow/Keras SavedModel. Requires the ``[generative]`` optional dependencies: ``pip install deepextractor[generative]``.