Testing Utilities

pyroed.testing.generate_fake_data(schema: Dict[str, List[Optional[str]]], feature_blocks: List[List[str]], sequences_per_batch: int, num_batches: int = 1) Tuple[Dict[str, torch.Tensor], Dict[str, torch.Tensor]][source]

Generates a fake dataset for testing.

Parameters
  • schema (OrderedDict) – A schema dict.

  • constraints (list) – A list of constraints.

  • feature_blocks (list) – A list of choice blocks for linear regression.

  • sequences_per_batch (int) – The number of sequences per experiment batch.

  • num_batches (int) – The number of experiment batches.

Returns

A pair (truth, experiment), where truth is a dict of true values of latent variables (regression coefficients, etc.), and experiment is a standard experiment dict.

Return type

tuple