Custom Dataclasses

Custom (partially nested) dataclasses describing configurations of individual components.

class ecgan.config.dataclasses.OptimizerConfig(NAME, LR, WEIGHT_DECAY=None, MOMENTUM=None, DAMPENING=None, BETAS=None, EPS=None, ALPHA=None, CENTERED=None)[source]

Bases: object

Type hints for Optimizer dicts.

class ecgan.config.dataclasses.LossConfig(NAME, GRADIENT_PENALTY_WEIGHT=None, CLIPPING_BOUND=None, REDUCTION=None)[source]

Bases: object

Type hints for a generic loss configuration.

class ecgan.config.dataclasses.BaseCNNConfig(HIDDEN_CHANNELS)[source]

Bases: object

Generalized configuration of an CNN module.

class ecgan.config.dataclasses.BaseRNNConfig(HIDDEN_DIMS, HIDDEN_SIZE)[source]

Bases: object

Generalized configuration of an RNN module.

class ecgan.config.dataclasses.TrackingConfig(TRACKER_NAME, ENTITY, PROJECT, EXPERIMENT_NAME, LOCAL_SAVE, SAVE_PDF, S3_CHECKPOINT_UPLOAD, LOG_LEVEL='info')[source]

Bases: object

Config for tracking and logging information.

class ecgan.config.dataclasses.PreprocessingConfig(LOADING_DIR, NUM_WORKERS, WINDOW_LENGTH, WINDOW_STEP_SIZE, RESAMPLING_ALGORITHM, TARGET_SEQUENCE_LENGTH, LOADING_SRC, NUM_SAMPLES)[source]

Bases: object

Create a preprocessing config object.

static configure(loading_src, target_sequence_length, loading_dir='data', num_workers=4, window_length=0, window_step_size=0, resampling_algo='lttb', num_samples=0)[source]

Return a default preprocessing configuration.

class ecgan.config.dataclasses.SyntheticPreprocessingConfig(LOADING_DIR, NUM_WORKERS, WINDOW_LENGTH, WINDOW_STEP_SIZE, RESAMPLING_ALGORITHM, TARGET_SEQUENCE_LENGTH, LOADING_SRC, NUM_SAMPLES, RANGE, ANOMALY_PERCENTAGE, NOISE_PERCENTAGE, SYNTHESIS_SEED)[source]

Bases: ecgan.config.dataclasses.PreprocessingConfig

Preprocessing configuration for synthetic datasets.

static configure(loading_src, target_sequence_length, loading_dir='data', num_workers=4, window_length=0, window_step_size=0, resampling_algo='lttb', num_samples=0, data_range=(0, 25), anomaly_percentage=0.2, noise_percentage=0.5, synthesis_seed=1337)[source]

Provide a default configuration for a synthetic dataset.

Return type

Dict

class ecgan.config.dataclasses.SinePreprocessingConfig(LOADING_DIR, NUM_WORKERS, WINDOW_LENGTH, WINDOW_STEP_SIZE, RESAMPLING_ALGORITHM, TARGET_SEQUENCE_LENGTH, LOADING_SRC, NUM_SAMPLES, RANGE, ANOMALY_PERCENTAGE, NOISE_PERCENTAGE, SYNTHESIS_SEED, AMPLITUDE=3.0, FREQUENCY=3.0, PHASE=5.0, VERTICAL_TRANSLATION=1.0)[source]

Bases: ecgan.config.dataclasses.SyntheticPreprocessingConfig

Preprocessing config for the synthetic sine dataset.

static configure(loading_src, target_sequence_length, loading_dir='data', num_workers=4, window_length=0, window_step_size=0, resampling_algo='lttb', num_samples=0, data_range=(0, 25), anomaly_percentage=0.2, noise_percentage=0.5, synthesis_seed=1337, amplitude=3, frequency=3, phase=5, vertical_translation=1)[source]

Return the default configuration for the sine dataset.

Return type

Dict

class ecgan.config.dataclasses.TrainerConfig(NUM_WORKERS, CHANNELS, EPOCHS, BATCH_SIZE, TRANSFORMATION, SPLIT_PATH, SPLIT_METHOD, SPLIT, TRAIN_ONLY_NORMAL, CROSS_VAL_FOLDS, CHECKPOINT_INTERVAL, SAMPLE_INTERVAL, BINARY_LABELS, MANUAL_SEED)[source]

Bases: object

Used to initialize a config for training.

static configure(transformation=Transformation.NONE, num_workers=4, epochs=500, batch_size=64, split_path='split.pkl', split_method='random', split=(0.85, 0.15), cross_val_folds=5, checkpoint_interval=10, sample_interval=1, train_only_normal=True, binary_labels=True, channels=0, manual_seed=93461)[source]

Return a default configuration for the trainer.

property transformation: ecgan.utils.custom_types.Transformation

Return an instance of the internal enum class Transformation.

Return type

Transformation

class ecgan.config.dataclasses.WeightInitializationConfig(NAME)[source]

Bases: object

Base weight initialization config.

class ecgan.config.dataclasses.NormalInitializationConfig(NAME, MEAN, STD)[source]

Bases: ecgan.config.dataclasses.WeightInitializationConfig

Base weight initialization config for drawing from a normal distribution.

class ecgan.config.dataclasses.UniformInitializationConfig(NAME, LOWER_BOUND, UPPER_BOUND)[source]

Bases: ecgan.config.dataclasses.WeightInitializationConfig

Base weight initialization config for drawing from a uniform distribution.

class ecgan.config.dataclasses.DetectionConfig(DETECTOR, BATCH_SIZE, NUM_WORKERS, AMOUNT_OF_RUNS, SAVE_DATA)[source]

Bases: object

Generalized configuration of a module.