Generation Configuration

class IntersectCases(*values)

Bases: Enum

INTERSECT = 'intersect'
OTHER = 'other'
class DiagramGenerationConfig(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

min_pts: int

The minimum number of points added to the original diagram.

max_pts: int

The maximum number of points added to the original diagram.

initial_jgex_problem: Optional[str]

If the user provides this, we’ll use the JGEX problem as a starting point for the generation.

output_gcs_file: str | None
emit_only_double_checked_aux_subproblems: bool

If true, we only emit subproblems that require aux constructions.

aux_discriminator: Literal['he_point_deps', 'newclid_traceback']

The discriminator to use to split subgoals points into setup and aux points.

debug: bool

Whether to run in single-process debug mode.

debug_problem: Optional[str]

If the user provides this, we’ll use it as the problem.

double_check_probability: float

Probability of double-checking the subproblem with and without auxiliary constructions. Will only apply to subproblems with at least one auxiliary constructions.

skip_aux_setup_pairs_previous_false_positive: bool

If true, we will skip subproblems that have an aux setup pair that was a false positive on a previous goal.

min_rules_applied: int

The minimum number of rules applied in the subproblem to not be skipped.

random_seed: Optional[int]

If provided, we will use this seed for the random number generator. Otherwise, we will use the current time as a seed.

attempts_per_diagram_build: int

How many times we try to find a configuration of points in 2D that satisfy the assumptions of the problem.

max_check_per_predicate: int

The maximum number of times we will double-check a subproblem with goal of each predicate type within a diagram.

construction_counter_reporting_rate: float

How often we report the construction attempt counters. Should be between 0 and 1.

attempts_per_clause: int

Each time we sample a JGEX clause, we will try to find input arguments that work this number of times before giving up on it. The input arguments are sampled uniformly at random from the set of all possible input arguments.

aux_tag: Literal['!aux', '']

The tag to use for prefixing auxiliary constructions.

pmf_additional_free_points_sweep: list[dict[int, float]]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pmf_intersect_vs_other_sweep: list[dict[IntersectCases, float]]
pmf_num_intersecting_to_sample_sweep: list[dict[int, float]]
run_uuid: str
timeout: float | None

Timeout (in seconds) for the generation process. (Used in tests)

n_workers: int | Literal['auto']
jsonl_dump_file: Path
log_level: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']

The log level to use for the generation process.

classmethod validate_pmf_sweep(pmf_sweep)
Return type:

list[dict[TypeVar(T), float]]

classmethod validate_output_gcs_file(gcs_file)
Return type:

str | None

validate_min_max_pts()
Return type:

Self

class SweepSelection(**data)

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

additional_free_points_sweep_selection: int
intersect_vs_other_sweep_selection: int
num_intersecting_to_sample_sweep_selection: int
sample_sweep_parameters(cfg, rng)

Sample sweep parameters from the configuration and return a new config instance.

Parameters:

cfg (DiagramGenerationConfig) – The base configuration to sample from

Return type:

SweepSelection

Returns:

A new configuration instance with sampled sweep parameters