Logic Function Datasets
truth_table_dataset
Section titled “truth_table_dataset”Defined in: griffith_logic.datasets.logic.truth_table_dataset (function)
def truth_table_dataset( table: TruthTable, n_inputs: int, n_outputs: int, repeat: int = 1,) -> TensorDatasetBuilds a TensorDataset enumerating all 2^n_inputs rows of a truth table.
Arguments
table— the truth table. Either a function fn(tuple of input bits) -> output bits, a list of output bit strings (in butterfly pattern order: bit j of pattern k = (k>>j)&1), or a mapping {tuple of input bits | pattern number k: output bits}n_inputs— number of input bitsn_outputs— number of output bitsrepeat— how many times to replicate the full pattern set (to tune epochs in batch training)
Returns
TensorDataset(X, Y). X: (2^n_inputs·repeat, n_inputs) float32 {0,1}, Y: (2^n_inputs·repeat, n_outputs) float32 {0,1}
LogicDatasetSpec
Section titled “LogicDatasetSpec”Defined in: griffith_logic.datasets.logic.LogicDatasetSpec (class)
class LogicDatasetSpec(name: str, n_inputs: int, n_outputs: int, dataset: TensorDataset)Specification of a logic function dataset (the unit looked up from the registry by, for example, the editor backend)
LOGIC_DATASETS
Section titled “LOGIC_DATASETS”Defined in: griffith_logic.datasets.logic.LOGIC_DATASETS (constant)
LOGIC_DATASETS: dict[str, Callable[..., LogicDatasetSpec]](no docstring yet)