snorkel-team / snorkel
Showing 1 of 2 files from the diff.

@@ -58,7 +58,7 @@
Loading
58 58
    optimizer_config: OptimizerConfig = OptimizerConfig()  # type: ignore
59 59
    lr_scheduler: str = "constant"
60 60
    lr_scheduler_config: LRSchedulerConfig = LRSchedulerConfig()  # type: ignore
61 -
    prec_init: float = 0.7
61 +
    prec_init: Union[float, List[float], np.ndarray, torch.Tensor] = 0.7
62 62
    seed: int = np.random.randint(1e6)
63 63
    log_freq: int = 10
64 64
    mu_eps: Optional[float] = None
@@ -280,6 +280,14 @@
Loading
280 280
        # Handle single values
281 281
        if isinstance(self.train_config.prec_init, (int, float)):
282 282
            self._prec_init = self.train_config.prec_init * torch.ones(self.m)
283 +
        elif isinstance(self.train_config.prec_init, np.ndarray):
284 +
            self._prec_init = torch.Tensor(self.train_config.prec_init)
285 +
        elif isinstance(self.train_config.prec_init, list):
286 +
            self._prec_init = torch.Tensor(self.train_config.prec_init)
287 +
        elif not isinstance(self.train_config.prec_init, torch.Tensor):
288 +
            raise TypeError(
289 +
                f"prec_init is of type {type(self.train_config.prec_init)} which is not supported currently."
290 +
            )
283 291
        if self._prec_init.shape[0] != self.m:
284 292
            raise ValueError(f"prec_init must have shape {self.m}.")
285 293
Files Coverage
snorkel 97.31%
Project Totals (68 files) 97.31%
384.1
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
TOXENV=coverage,complex,spark,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