Reference

class qusi.data.LightCurve

A class to represent a light curve. A light curve is a collection of data which may includes times, fluxes, and related values.

Variables:
  • times – The times of the light curve.

  • fluxes – The fluxes of the light curve.

classmethod new(times: ndarray[Any, dtype[float32]], fluxes: ndarray[Any, dtype[float32]]) Self

Creates a new light curve.

Parameters:
  • times – The times of the light curve.

  • fluxes – The fluxes of the light curve.

Returns:

The light curve.

class qusi.data.LightCurveCollection

A collection of light curves, including where to find paths to the data and how to load the data.

Variables:
  • path_getter – The PathIterableBase object for the collection.

  • load_times_and_fluxes_from_path_function – The function to load the times and fluxes from the light curve.

classmethod new(get_paths_function: Callable[[], Iterable[Path]], load_times_and_fluxes_from_path_function: Callable[[Path], tuple[npt.NDArray[np.float32], npt.NDArray[np.float32]]]) Self

Creates a new light curve collection.

Parameters:
  • get_paths_function – The function to load the list of paths.

  • load_times_and_fluxes_from_path_function – The function to load the times and fluxes from the light curve.

Returns:

The light curve collection.

class qusi.data.LightCurveDataset

A dataset of light curves. Includes cases where light curves can be injected into one another.

classmethod new(standard_light_curve_collections: list[LightCurveObservationCollection] | None = None, *, injectee_light_curve_collections: list[LightCurveObservationCollection] | None = None, injectable_light_curve_collections: list[LightCurveObservationCollection] | None = None, post_injection_transform: Callable[[Any], Any] | None = None) Self

Creates a new light curve dataset.

Parameters:
  • standard_light_curve_collections – The light curve collections to be used without injection.

  • injectee_light_curve_collections – The light curve collections that other light curves will be injected into.

  • injectable_light_curve_collections – The light curve collections that will be injected into other light curves.

Returns:

The light curve dataset.

class qusi.data.LightCurveObservationCollection

A collection of light curve observations. Includes where to find the light curve data paths, and how to load the times, fluxes, and label data.

Variables:
  • path_getter – The PathGetterBase object for the collection.

  • light_curve_collection – The LightCurveCollectionBase object for the collection.

  • load_label_from_path_function – The function to load the label for the light curve.

classmethod new(get_paths_function: Callable[[], Iterable[Path]], load_times_and_fluxes_from_path_function: Callable[[Path], tuple[npt.NDArray[np.float32], npt.NDArray[np.float32]]], load_label_from_path_function: Callable[[Path], int]) Self

Creates a new light curve collection.

Parameters:
  • get_paths_function – The function to load the list of paths.

  • load_times_and_fluxes_from_path_function – The function to load the times and fluxes from the light curve.

  • load_label_from_path_function – The function to load the label for the light curve.

Returns:

The light curve collection.

class qusi.data.FiniteStandardLightCurveDataset

A finite light curve dataset without injection.

classmethod new(light_curve_collections: list[LightCurveCollection], *, post_injection_transform: Callable[[Any], Any] | None = None) Self

Creates a new FiniteStandardLightCurveDataset.

Parameters:
  • light_curve_collections – The light curve collections to include in the dataset.

  • post_injection_transform – Transforms to the data to occur after injection.

Returns:

The dataset.

class qusi.data.FiniteStandardLightCurveObservationDataset

A finite light curve observation dataset without injection.

classmethod new(light_curve_collections: list[LightCurveObservationCollection], *, post_injection_transform: Callable[[Any], Any] | None = None) Self

Creates a new FiniteStandardLightCurveObservationDataset.

Parameters:
  • light_curve_collections – The light curve observation collections to include in the dataset.

  • post_injection_transform – Transforms to the data to occur after injection.

Returns:

The dataset.

class qusi.model.Hadryss

A 1D convolutional neural network model for light curve data that will auto-size itself for a given input light curve length.

classmethod new(input_length: int = 3500, end_module: Module | None = None) Self

Creates a new Hadryss model.

Parameters:
  • input_length – The length of the input to auto-size the network to.

  • end_module – The end module of the network. Defaults to a HadryssBinaryClassEndModule.

Returns:

The model.

qusi.session.get_device() device | str | int | None

Gets the available device for PyTorch to run on.

Returns:

The device.

qusi.session.infer_session(infer_datasets: list[FiniteStandardLightCurveDataset], model: Module, *, batch_size: int, device: device | str | int | None, workers_per_dataloader: int = 0) list[ndarray]

Runs an infer session on finite datasets.

Parameters:
  • infer_datasets – The list of datasets to run the infer session on.

  • model – The model to perform the inference.

  • batch_size – The batch size to use during inference.

  • device – The device to run the model on.

Returns:

A list of arrays with each element being the array predicted for each light curve in the dataset.

qusi.session.train_session(train_datasets: list[LightCurveDataset], validation_datasets: list[LightCurveDataset], model: Module, optimizer: Optimizer | None = None, loss_metric: Module | None = None, logging_metrics: list[Module] | None = None, *, hyperparameter_configuration: TrainHyperparameterConfiguration | None = None, system_configuration: TrainSystemConfiguration | None = None, logging_configuration: TrainLoggingConfiguration | None = None, loss_function: Module | None = None, metric_functions: list[Module] | None = None) None

Runs a training session.

Parameters:
  • train_datasets – The datasets to train on.

  • validation_datasets – The datasets to validate on.

  • model – The model to train.

  • optimizer – The optimizer to be used during training.

  • loss_metric – The loss function to train the model on.

  • logging_metrics – A list of metric functions to record during the training process.

  • hyperparameter_configuration – The configuration of the hyperparameters.

  • system_configuration – The configuration of the system.

  • logging_configuration – The configuration of the logging.

class qusi.session.TrainHyperparameterConfiguration

Hyperparameter configuration settings for a train session.

Variables:
  • cycles – The number of cycles to run. Cycles consist of one set of training steps and one set of validation steps. They can be seen as analogous to epochs. However, as qusi datasets are often infinite or have different length sub-collections, there is not always the exact equivalent of an epoch, so cycles are used instead.

  • train_steps_per_cycle – The number of training steps per cycle.

  • validation_steps_per_cycle – The number of validation steps per cycle.

  • batch_size – The size of the batch for each train process. Each training step will use a number of observations equal to this value multiplied by the number of train processes.

  • norm_based_gradient_clip – The norm based gradient clipping value.

classmethod new(*, cycles: int = 5000, train_steps_per_cycle: int = 100, validation_steps_per_cycle: int = 10, batch_size: int = 100, norm_based_gradient_clip: float = 1.0)

Creates a new TrainHyperparameterConfiguration.

Parameters:
  • cycles – The number of cycles to run. Cycles consist of one set of training steps and one set of validation steps. They can be seen as analogous to epochs. However, as qusi datasets are often infinite or have different length sub-collections, there is not always the exact equivalent of an epoch, so cycles are used instead.

  • train_steps_per_cycle – The number of training steps per cycle.

  • validation_steps_per_cycle – The number of validation steps per cycle.

  • batch_size – The size of the batch for each train process. Each training step will use a number of observations equal to this value multiplied by the number of train processes.

  • norm_based_gradient_clip – The norm based gradient clipping value.

Returns:

The hyperparameter configuration.