ramjet.photometric_database.lightcurve_label_per_time_step_database¶
Code for representing a database of lightcurves for binary classification with a single label per time step.
Module Contents¶
-
class
LightcurveLabelPerTimeStepDatabase(data_directory='data')[source]¶ Bases:
ramjet.photometric_database.lightcurve_database.LightcurveDatabaseA representation of a database of lightcurves for binary classification with a single label per time step.
-
training_preprocessing(self, example_path_tensor: tf.Tensor)[source]¶ Loads and preprocesses the data for training.
Parameters: example_path_tensor – The tensor containing the path to the example to load. Returns: The example and its corresponding label.
-
evaluation_preprocessing(self, example_path_tensor: tf.Tensor)[source]¶ Loads and preprocesses the data for evaluation.
Parameters: example_path_tensor – The tensor containing the path to the example to load. Returns: The example and its corresponding label.
-
general_preprocessing(self, example_path_tensor: tf.Tensor)[source]¶ Loads and preprocesses the data.
Parameters: example_path_tensor – The tensor containing the path to the example to load. Returns: The example and its corresponding label.
-
make_uniform_length_requiring_positive(self, example: np.ndarray, label: np.ndarray, length: Union[int, None] = None, required_length_multiple_base: Union[int, None] = None)[source]¶ Extracts a random segment from an example of the length specified. For examples with a positive label, the segment is required to include at least 1 positive time step. Examples shorter than the specified length will be repeated to fit the length.
Parameters: - example – The example to extract a segment from.
- label – The label whose matching segment should be extracted.
- length – The length to make the example.
- required_length_multiple_base – An optional base which the length is rounded to.
Returns: The extracted segment and corresponding label.
-
static
valid_start_indexes_for_segment_including_positive(boolean_array: np.bool, segment_length: int)[source]¶ Gets all indexes of an array where a segment started at that index will include at least one True entry. In other words, an
Parameters: - boolean_array – The array indicating which positions are positive.
- segment_length – The length of the segments to consider.
Returns: The valid start indexes.
-