ytm._core.config.BaseTMConfig#
- class ytm._core.config.BaseTMConfig#
Bases:
objectSettings shared by all TM models.
See also
ytm._core.initializerAvailable TA initializers.
- n_clauses: int#
Number of clauses per class or clause bank, at least 1. When
coalesced, all classes share one clause bank, so total clauses =n_clauses. When not coalesced, total clauses =n_clauses * n_classes.
- dim: int | tuple[int, ...]#
Input shape:
D,(H, W)or(H, W, C). Missing trailing sizes are set to 1.
- feat_mins: int | Sequence[int] | ndarray = 0#
Inclusive integer range of each feature, together with
feat_maxs. For binary features, use 0 and 1 (the defaults). For thermometer encoded features, a feature usesfeat_maxs - feat_minsthermometer bits.A single int sets the same min or max for all features.
Without convolution, an array with one entry per feature sets min and max per feature.
With convolution, pass an int, or a tuple of length
Cfor min and max per channel.
- feat_maxs: int | Sequence[int] | ndarray = 1#
Upper end of the inclusive integer range of each feature. See
feat_mins.
- patch_dim: tuple[int, int] | None = None#
Convolution window
(h, w). None means the whole image (no convolution). An entry <= 0 or larger than the image uses the full size in that axis.
- track_patch_weights: bool = True#
Count, per clause and patch, which patches the clause picks. Needed by
wicon convolutional models.
- coalesced: bool = True#
One clause bank shared by all classes with per-class weights. False gives each class its own bank.
- negative_clauses: bool = True#
Start half the clauses with negative polarity (voting against a class).
- position_literals: bool = True#
Add thermometer-coded patch position literals. Only used when there is more than one patch.
- max_includes: int | None = None#
Literal budget of a clause. None, <= 0 or more than the literal count means no limit.
- include_state: int | None = None#
Lowest state that counts as include. None or -1 means
n_states // 2.
- ta_init: Literal['random', 'middle', 'random_include'] | str | int | TAInit = 'middle'#
Initial TA states.
"middle": just below include."random": uniform over all states."random_include": uniform over the two states around the include boundary."random:N": uniform in a band ofNstates on each side of the boundary.An int sets every TA to that state.
A
TAInit(TA initializer) defines how to initialize the states or clauses.
- boost_tp_inc: bool = True#
Type Ia increment steps for true literals always happen, instead of with probability
1 - 1/s.