@@ -124,7 +124,7 @@
Loading
124 124
        elif not self.checkpoint_condition_met and iteration >= self.checkpoint_runway:
125 125
            self.checkpoint_condition_met = True
126 126
            logging.info(
127 -
                f"checkpoint_runway condition has been met. Start checkpointing."
127 +
                "checkpoint_runway condition has been met. Start checkpointing."
128 128
            )
129 129
130 130
        checkpoint_path = f"{self.checkpoint_dir}/checkpoint_{iteration}.pth"
@@ -187,7 +187,7 @@
Loading
187 187
        """Load the best model from the checkpoint."""
188 188
        metric = list(self.checkpoint_metric.keys())[0]
189 189
        if metric not in self.best_metric_dict:  # pragma: no cover
190 -
            logging.info(f"No best model found, use the original model.")
190 +
            logging.info("No best model found, use the original model.")
191 191
        else:
192 192
            # Load the best model of checkpoint_metric
193 193
            best_model_path = (

@@ -179,7 +179,7 @@
Loading
179 179
        # Set to training mode
180 180
        model.train()
181 181
182 -
        logging.info(f"Start training...")
182 +
        logging.info("Start training...")
183 183
184 184
        self.metrics: Dict[str, float] = dict()
185 185
        self._reset_losses()
@@ -372,7 +372,7 @@
Loading
372 372
        if self.config.lr_scheduler_config.warmup_steps:
373 373
            warmup_steps = self.config.lr_scheduler_config.warmup_steps
374 374
            if warmup_steps < 0:
375 -
                raise ValueError(f"warmup_steps much greater or equal than 0.")
375 +
                raise ValueError("warmup_steps much greater or equal than 0.")
376 376
            warmup_unit = self.config.lr_scheduler_config.warmup_unit
377 377
            if warmup_unit == "epochs":
378 378
                self.warmup_steps = int(warmup_steps * self.n_batches_per_epoch)

@@ -577,7 +577,7 @@
Loading
577 577
    def _set_constants(self, L: np.ndarray) -> None:
578 578
        self.n, self.m = L.shape
579 579
        if self.m < 3:
580 -
            raise ValueError(f"L_train should have at least 3 labeling functions")
580 +
            raise ValueError("L_train should have at least 3 labeling functions")
581 581
        self.t = 1
582 582
583 583
    def _create_tree(self) -> None:
@@ -679,7 +679,7 @@
Loading
679 679
        if self.train_config.lr_scheduler_config.warmup_steps:
680 680
            warmup_steps = self.train_config.lr_scheduler_config.warmup_steps
681 681
            if warmup_steps < 0:
682 -
                raise ValueError(f"warmup_steps much greater or equal than 0.")
682 +
                raise ValueError("warmup_steps much greater or equal than 0.")
683 683
            warmup_unit = self.train_config.lr_scheduler_config.warmup_unit
684 684
            if warmup_unit == "epochs":
685 685
                self.warmup_steps = int(warmup_steps)

@@ -94,10 +94,10 @@
Loading
94 94
    if "base" not in slice_names:
95 95
        slice_names = slice_names + ["base"]
96 96
97 -
    slice_tasks = []
97 +
    slice_tasks: List[Task] = []
98 98
99 99
    # Keep track of all operations related to slice tasks
100 -
    slice_task_ops = []
100 +
    slice_task_ops: List[Operation] = []
101 101
102 102
    # NOTE: We assume here that the last operation uses the head module
103 103
    # Identify base task head module
@@ -108,7 +108,9 @@
Loading
108 108
        head_module = head_module.module
109 109
110 110
    neck_size = head_module.in_features
111 +
    assert isinstance(neck_size, int)
111 112
    base_task_cardinality = head_module.out_features
113 +
    assert isinstance(base_task_cardinality, int)
112 114
113 115
    # Remove the slice-unaware head module from module pool and op sequence
114 116
    del base_task.module_pool[head_module_op.module_name]
Files Coverage
snorkel 97.18%
Project Totals (67 files) 97.18%
318.1
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
TOXENV=coverage,doctest,type,check
1
coverage:
2
  status:
3
    project:
4
      default:
5
        target: 95%
6
    patch:
7
      default:
8
        threshold: 2%
9

10
comment:
11
  layout: "header, diff, flags, files"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading