Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #482 from ML4GW/paper
Browse files Browse the repository at this point in the history
Merge `paper` into `main`
  • Loading branch information
wbenoit26 authored Mar 7, 2024
2 parents 3f45149 + c4b949c commit 8012bc1
Show file tree
Hide file tree
Showing 60 changed files with 23,448 additions and 1,316 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import logging
from pathlib import Path
from typing import Callable, List, Optional

from export.main import main as export

import hermes.quiver as qv
from aframe.architectures import architecturize
from aframe.logging import configure_logging


@architecturize
def main(
architecture: Callable,
repository_directory: Path,
logdir: Path,
num_ifos: int,
kernel_length: float,
inference_sampling_rates: List[float],
sample_rate: float,
batch_size: int,
fduration: float,
psd_length: float,
fftlength: Optional[float] = None,
highpass: Optional[float] = None,
weights: Optional[Path] = None,
streams_per_gpu: int = 1,
aframe_instances: Optional[int] = None,
platform: qv.Platform = qv.Platform.ONNX,
clean: bool = False,
verbose: bool = False,
):
configure_logging(logdir / "inference_rates_export.log", verbose=verbose)

for rate in inference_sampling_rates:
current_repo_dir = repository_directory / f"{rate}Hz"

logging.info(f"Starting export with inference rate {rate} Hz")

export(
architecture=architecture,
repository_directory=current_repo_dir,
logdir=logdir,
num_ifos=num_ifos,
kernel_length=kernel_length,
inference_sampling_rate=rate,
sample_rate=sample_rate,
batch_size=batch_size,
fduration=fduration,
psd_length=psd_length,
fftlength=fftlength,
highpass=highpass,
weights=weights,
streams_per_gpu=streams_per_gpu,
aframe_instances=aframe_instances,
platform=platform,
clean=clean,
verbose=verbose,
)

logging.info(f"Finished export with inference rate {rate} Hz")
Loading

0 comments on commit 8012bc1

Please sign in to comment.