Models
Concrete TSK model variants.
All public model classes are re-exported from their respective sub-modules.
ADATSKClassifierModel
Bases: BaseTSKClassifierModel
TSK classifier with adaptive softmin antecedent (ADATSK).
The firing strength of each rule is computed with the Ada-softmin operator.
Reference
G. Xue, Q. Chang, J. Wang, K. Zhang and N. R. Pal, "An Adaptive Neuro-Fuzzy System With Integrated Feature Selection and Rule Extraction for High-Dimensional Classification Problems," in IEEE Transactions on Fuzzy Systems, vol. 31, no. 7, pp. 2167-2181, July 2023, doi: 10.1109/TFUZZ.2022.3220950.
Initialise the ADATSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon for the Ada-softmin operator. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_adaptive.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
ADATSKRegressorModel
Bases: BaseTSKRegressorModel
TSK regressor with adaptive softmin antecedent (ADATSK).
The firing strength of each rule is computed with the Ada-softmin operator.
Reference
G. Xue, Q. Chang, J. Wang, K. Zhang and N. R. Pal, "An Adaptive Neuro-Fuzzy System With Integrated Feature Selection and Rule Extraction for High-Dimensional Classification Problems," in IEEE Transactions on Fuzzy Systems, vol. 31, no. 7, pp. 2167-2181, July 2023, doi: 10.1109/TFUZZ.2022.3220950.
Initialise the ADATSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon for the Ada-softmin operator. |
None
|
Source code in highfis/models/_adaptive.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
ADMTSKClassifierModel
Bases: BaseTSKClassifierModel
Adaptive Dombi TSK classifier with Composite Gaussian membership functions.
ADMTSK is an adaptive Dombi TSK fuzzy system designed for high-dimensional inference. It combines a Dombi T-norm antecedent with a positive lower-bound Composite Gaussian membership function (CGMF) and normalized first-order consequents.
Reference
G. Xue, L. Hu, J. Wang and S. Ablameyko, "ADMTSK: A High-Dimensional Takagi-Sugeno-Kang Fuzzy System Based on Adaptive Dombi T-Norm," in IEEE Transactions on Fuzzy Systems, vol. 33, no. 6, pp. 1767-1780, June 2025, doi: 10.1109/TFUZZ.2025.3535640.
Initialize the ADMTSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of membership functions. |
required |
n_classes
|
int
|
Number of output classes. Must be >= 2. |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
t_norm
|
str | TNormFn
|
T-norm name or callable (default |
'dombi'
|
adaptive
|
bool
|
If True, compute adaptive lambda using the feature dimension and membership lower bound. |
True
|
lambda_
|
float
|
Fixed Dombi parameter |
1.0
|
lower_bound
|
float
|
The lower bound for Composite GMF values. |
1.0 / math.e
|
k
|
float
|
Heuristic constant used to compute adaptive lambda. |
10.0
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices for custom rule bases. |
None
|
defuzzifier
|
nn.Module | None
|
Optional defuzzifier module. |
None
|
consequent_batch_norm
|
bool
|
If True, apply batch normalization to consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_dombi.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
ADMTSKRegressorModel
Bases: BaseTSKRegressorModel
Adaptive Dombi TSK regressor with Composite Gaussian membership functions.
ADMTSK is an adaptive Dombi TSK fuzzy system designed for high-dimensional inference. It combines a Dombi T-norm antecedent with a positive lower-bound Composite Gaussian membership function (CGMF) and normalized first-order consequents.
Reference
G. Xue, L. Hu, J. Wang and S. Ablameyko, "ADMTSK: A High-Dimensional Takagi-Sugeno-Kang Fuzzy System Based on Adaptive Dombi T-Norm," in IEEE Transactions on Fuzzy Systems, vol. 33, no. 6, pp. 1767-1780, June 2025, doi: 10.1109/TFUZZ.2025.3535640.
Initialize the ADMTSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of membership functions. |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
t_norm
|
str | TNormFn
|
T-norm name or callable (default |
'dombi'
|
adaptive
|
bool
|
If True, compute adaptive lambda using the feature dimension and membership lower bound. |
True
|
lambda_
|
float
|
Fixed Dombi parameter |
1.0
|
lower_bound
|
float
|
The lower bound for Composite GMF values. |
1.0 / math.e
|
k
|
float
|
Heuristic constant used to compute adaptive lambda. |
10.0
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices for custom rule bases. |
None
|
defuzzifier
|
nn.Module | None
|
Optional defuzzifier module. |
None
|
consequent_batch_norm
|
bool
|
If True, apply batch normalization to consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_dombi.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
ADPTSKClassifierModel
Bases: BaseTSKClassifierModel
TSK classifier with adaptive double-parameter softmin antecedent (ADPTSK).
The firing strengths of each rule are computed with the ADP-softmin operator, and membership functions are wrapped as Gaussian PIMFs to preserve a positive infimum during high-dimensional training.
Reference
Ma, M., Qian, L., Zhang, Y., Fang, Q., & Xue, G. (2025). An adaptive double-parameter softmin based Takagi-Sugeno-Kang fuzzy system for high-dimensional data. Fuzzy Sets and Systems, 521, 109582. https://doi.org/10.1016/j.fss.2025.109582
Initialise the ADPTSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
kappa
|
float
|
ADP-softmin parameter |
690.0
|
xi
|
float
|
ADP-softmin parameter |
730.0
|
eps
|
float | None
|
Numerical stability epsilon. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_adaptive.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
ADPTSKRegressorModel
Bases: BaseTSKRegressorModel
TSK regressor with adaptive double-parameter softmin antecedent (ADPTSK).
The firing strengths of each rule are computed with the ADP-softmin operator, and membership functions are wrapped as Gaussian PIMFs to preserve a positive infimum during high-dimensional training.
Reference
Ma, M., Qian, L., Zhang, Y., Fang, Q., & Xue, G. (2025). An adaptive double-parameter softmin based Takagi-Sugeno-Kang fuzzy system for high-dimensional data. Fuzzy Sets and Systems, 521, 109582. https://doi.org/10.1016/j.fss.2025.109582
Initialise the ADPTSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
kappa
|
float
|
ADP-softmin parameter |
690.0
|
xi
|
float
|
ADP-softmin parameter |
730.0
|
eps
|
float | None
|
Numerical stability epsilon. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_adaptive.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
AYATSKClassifierModel
Bases: BaseTSKClassifierModel
TSK classifier with an adaptive Yager T-norm in the antecedent.
AYATSK extends TSK by using an adaptive Yager T-norm aggregation and optional positive lower-bound membership functions to improve stability and performance in high-dimensional settings.
Reference
G. Xue, Y. Yang and J. Wang, "Adaptive Yager T-Norm-Based Takagi-Sugeno-Kang Fuzzy Systems," in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 55, no. 12, pp. 9802-9815, Dec. 2025, doi: 10.1109/TSMC.2025.3621346.
Initialise the AYATSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
t_norm
|
str | TNormFn
|
T-norm name or callable (default |
'yager'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_yager.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
AYATSKRegressorModel
Bases: BaseTSKRegressorModel
TSK regressor with an adaptive Yager T-norm in the antecedent.
AYATSK extends TSK by using an adaptive Yager T-norm aggregation and optional positive lower-bound membership functions to improve stability and performance in high-dimensional settings.
Reference
G. Xue, Y. Yang and J. Wang, "Adaptive Yager T-Norm-Based Takagi-Sugeno-Kang Fuzzy Systems," in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 55, no. 12, pp. 9802-9815, Dec. 2025, doi: 10.1109/TSMC.2025.3621346.
Initialise the AYATSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
t_norm
|
str | TNormFn
|
T-norm name or callable (default |
'yager'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Source code in highfis/models/_yager.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
BaseTSKClassifierModel
Bases: BaseTSK
Abstract classifier base that provides task-specific training and inference helpers.
Initialize the TSK pipeline layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature names to sequences of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. Supported values:
|
'cartesian'
|
t_norm
|
str | TNormFn
|
T-norm name or callable. Common string values: |
'gmean'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule index sequences. Required when
rule_base is |
None
|
defuzzifier
|
Defuzzifier | None
|
Normalization module applied to raw rule firing
strengths. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
If |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If input_mfs is empty. |
Source code in highfis/base.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
BaseTSKRegressorModel
Bases: BaseTSK
Abstract regressor base that provides task-specific training and inference helpers.
Initialize the TSK pipeline layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature names to sequences of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. Supported values:
|
'cartesian'
|
t_norm
|
str | TNormFn
|
T-norm name or callable. Common string values: |
'gmean'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule index sequences. Required when
rule_base is |
None
|
defuzzifier
|
Defuzzifier | None
|
Normalization module applied to raw rule firing
strengths. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
If |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If input_mfs is empty. |
Source code in highfis/base.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
DGALETSKClassifierModel
Bases: BaseTSKClassifierModel
DG-ALETSK classifier with ALE-softmin antecedent and double-group gates.
DG-ALETSK extends FSRE-ADATSK by replacing the adaptive softmin with the Adaptive Ln-Exp (ALE) softmin — a smoother variant with improved numerical stability. It also uses a zero-order consequent in the DG (data-guided) training phase and optionally converts to first-order after gate-based pruning.
Reference
G. Xue, J. Wang, B. Yuan and C. Dai, "DG-ALETSK: A High-Dimensional Fuzzy Approach With Simultaneous Feature Selection and Rule Extraction," in IEEE Transactions on Fuzzy Systems, vol. 31, no. 11, pp. 3866-3880, Nov. 2023, doi: 10.1109/TFUZZ.2023.3270445.
Initialise the DG-ALETSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices; ignored when
|
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon for the ALE-softmin operator. |
None
|
use_en_frb
|
bool
|
Start directly from the Enhanced FRB (En-FRB). |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_dg_aletsk.py
apply_thresholds
Apply threshold pruning to feature and rule gates.
Source code in highfis/models/_dg_aletsk.py
compute_thresholds
Compute feature and rule thresholds from gate values and coefficient pairs.
Source code in highfis/models/_dg_aletsk.py
convert_to_first_order
Convert the DG phase zero-order consequent to first-order form.
Source code in highfis/models/_dg_aletsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
fit_dg_phase
fit_finetune
Fine-tune the DG-ALETSK classifier after converting to first-order.
Consequent weights are reset to zero, antecedent parameters (MFs) and feature-selection gates (λ) are frozen per paper §3.3.
Source code in highfis/models/_dg_aletsk.py
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_feature_gate_values
Return normalized antecedent feature gate values for the DG phase.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_gate_values
Return normalized consequent rule gate values for the DG phase.
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
search_thresholds
Search threshold coefficients for feature and rule pruning.
The search follows the DG-ALETSK paper strategy: thresholds are computed from gate values, applied to prune gates, and the first-order consequent parameters are refit with antecedents fixed.
Source code in highfis/models/_dg_aletsk.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
DGALETSKRegressorModel
Bases: BaseTSKRegressorModel
DG-ALETSK regressor with ALE-softmin antecedent and double-group gates.
DG-ALETSK extends FSRE-ADATSK by replacing the adaptive softmin with the Adaptive Ln-Exp (ALE) softmin — a smoother variant with improved numerical stability. It also uses a zero-order consequent in the DG (data-guided) training phase and optionally converts to first-order after gate-based pruning.
Reference
G. Xue, J. Wang, B. Yuan and C. Dai, "DG-ALETSK: A High-Dimensional Fuzzy Approach With Simultaneous Feature Selection and Rule Extraction," in IEEE Transactions on Fuzzy Systems, vol. 31, no. 11, pp. 3866-3880, Nov. 2023, doi: 10.1109/TFUZZ.2023.3270445.
Initialise the DG-ALETSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices; ignored when
|
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon for the ALE-softmin operator. |
None
|
use_en_frb
|
bool
|
Start directly from the Enhanced FRB (En-FRB). |
False
|
Source code in highfis/models/_dg_aletsk.py
apply_thresholds
Apply threshold pruning to feature and rule gates.
Source code in highfis/models/_dg_aletsk.py
compute_thresholds
Compute feature and rule thresholds from gate values and coefficient pairs.
Source code in highfis/models/_dg_aletsk.py
convert_to_first_order
Convert the DG phase zero-order consequent to first-order form.
Source code in highfis/models/_dg_aletsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
fit_dg_phase
fit_finetune
Fine-tune the DG-ALETSK regressor after converting to first-order.
Consequent weights are reset to zero, antecedent parameters (MFs) and feature-selection gates (λ) are frozen per paper §3.3.
Source code in highfis/models/_dg_aletsk.py
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_feature_gate_values
Return normalized antecedent feature gate values for the DG phase.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_gate_values
Return normalized consequent rule gate values for the DG phase.
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
search_thresholds
Search threshold coefficients for feature and rule pruning.
Source code in highfis/models/_dg_aletsk.py
DGTSKClassifierModel
Bases: BaseTSKClassifierModel
DG-TSK classifier with M-gate antecedent and point-based FRB (P-FRB).
DG-TSK uses a data-guided M-gate function to automatically select relevant features and rules.
Reference
Guangdong Xue, Jian Wang, Bingjie Zhang, Bin Yuan, Caili Dai, Double groups of gates based Takagi-Sugeno-Kang (DG-TSK) fuzzy system for simultaneous feature selection and rule extraction, Fuzzy Sets and Systems, Volume 469, 2023, 108627, ISSN 0165-0114, https://doi.org/10.1016/j.fss.2023.108627.
Initialise the DG-TSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
gate_fea
|
str | Callable[[Tensor], Tensor] | None
|
Gate function for antecedent feature selection.
|
'gate_m'
|
gate_rule
|
str | Callable[[Tensor], Tensor] | None
|
Gate function for consequent rule selection.
Same options as |
'gate_m'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices; ignored when
|
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon. |
None
|
use_en_frb
|
bool
|
Use the Enhanced FRB (P-FRB) rule base. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_dg_tsk.py
apply_thresholds
Prune DG-TSK feature and rule gates using the computed thresholds.
Source code in highfis/models/_dg_tsk.py
compute_thresholds
Compute DG-TSK pruning thresholds from gate values and zeta parameters.
Source code in highfis/models/_dg_tsk.py
convert_to_first_order
Convert the DG-TSK model from zero-order to first-order consequent.
Source code in highfis/models/_dg_tsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
fit_dg_phase
Train the DG-TSK zero-order phase with antecedent parameters frozen (paper §3.3).
Gate parameters (λ, θ) and zero-order consequent parameters are optimised. Antecedent parameters (MF centres and spreads) are held fixed, as stated in Xue et al. (2023): "Note that the antecedent parameters are not included."
Source code in highfis/models/_dg_tsk.py
fit_finetune
Fine-tune the DG-TSK classifier after conversion to first-order consequents.
Consequent weights and biases are reset to zero before retraining, as stated in Xue et al. (2023): "Before the training for fine tuning, all the consequent parameters are set to zero in our experiments."
Antecedent parameters (MF centres/spreads) and feature-selection gates (λ) are frozen during fine-tuning, per paper §3.3: "we fix the first group of gates and the membership functions."
Source code in highfis/models/_dg_tsk.py
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_feature_gate_values
Return normalized DG-TSK feature gate activations from lambda values.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_gate_values
Return normalized DG-TSK rule gate activations from theta values.
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
init_consequents_from_labels
Initialise zero-order consequent biases with one-hot encoded labels (P-FRB paper eq. 24).
Sets consequent_layer.bias[r, c] = 1 when sample r belongs to class c,
exactly as in Xue et al. (2023) eq. (24): \(p^0_{r,c} = y_{r,c}\).
Should be called before :meth:fit_dg_phase when using P-FRB.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
y
|
Tensor
|
Integer class labels of shape |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model is not in zero-order consequent mode. |
Source code in highfis/models/_dg_tsk.py
predict
predict_proba
search_thresholds
Search DG-TSK threshold combinations and optionally apply the best candidate.
Source code in highfis/models/_dg_tsk.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | |
DGTSKRegressorModel
Bases: BaseTSKRegressorModel
DG-TSK regressor with M-gate antecedent and point-based FRB (P-FRB).
DG-TSK uses a data-guided M-gate function to automatically select relevant features and rules.
Reference
Guangdong Xue, Jian Wang, Bingjie Zhang, Bin Yuan, Caili Dai, Double groups of gates based Takagi-Sugeno-Kang (DG-TSK) fuzzy system for simultaneous feature selection and rule extraction, Fuzzy Sets and Systems, Volume 469, 2023, 108627, ISSN 0165-0114, https://doi.org/10.1016/j.fss.2023.108627.
Initialise the DG-TSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
gate_fea
|
str | Callable[[Tensor], Tensor] | None
|
Gate function for antecedent feature selection
(default |
'gate_m'
|
gate_rule
|
str | Callable[[Tensor], Tensor] | None
|
Gate function for consequent rule selection
(default |
'gate_m'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices; ignored when
|
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon. |
None
|
use_en_frb
|
bool
|
Use the Enhanced FRB (P-FRB) rule base. |
False
|
Source code in highfis/models/_dg_tsk.py
apply_thresholds
Prune DG-TSK feature and rule gates using the computed thresholds.
Source code in highfis/models/_dg_tsk.py
compute_thresholds
Compute DG-TSK pruning thresholds from gate values and zeta parameters.
Source code in highfis/models/_dg_tsk.py
convert_to_first_order
Convert the DG-TSK regressor from zero-order to first-order consequent.
Source code in highfis/models/_dg_tsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
fit_dg_phase
Train the DG-TSK regression zero-order phase with antecedent parameters frozen (paper §3.3).
Gate parameters (λ, θ) and zero-order consequent parameters are optimised. Antecedent parameters (MF centres and spreads) are held fixed, as stated in Xue et al. (2023): "Note that the antecedent parameters are not included."
Source code in highfis/models/_dg_tsk.py
fit_finetune
Fine-tune the DG-TSK regression model after converting to first order.
Consequent weights and biases are reset to zero before retraining, as stated in Xue et al. (2023): "Before the training for fine tuning, all the consequent parameters are set to zero in our experiments."
Antecedent parameters (MF centres/spreads) and feature-selection gates (λ) are frozen during fine-tuning, per paper §3.3: "we fix the first group of gates and the membership functions."
Source code in highfis/models/_dg_tsk.py
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_feature_gate_values
Return normalized DG-TSK feature gate activations from lambda values.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_gate_values
Return normalized DG-TSK rule gate activations from theta values.
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
search_thresholds
Search DG-TSK regression threshold combinations and optionally apply the best candidate.
Source code in highfis/models/_dg_tsk.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | |
DombiTSKClassifierModel
Bases: BaseTSKClassifierModel
TSK classifier with a fixed Dombi T-norm in the antecedent.
DombiTSK extends TSK fuzzy inference by using a Dombi t-norm aggregation in antecedent evaluation while keeping first-order linear consequents.
Reference
G. Xue, L. Hu, J. Wang and S. Ablameyko, "ADMTSK: A High-Dimensional Takagi-Sugeno-Kang Fuzzy System Based on Adaptive Dombi T-Norm," in IEEE Transactions on Fuzzy Systems, vol. 33, no. 6, pp. 1767-1780, June 2025, doi: 10.1109/TFUZZ.2025.3535640.
Initialise the Dombi TSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
T-norm name or callable (default |
'dombi'
|
lambda_
|
float
|
Dombi parameter |
1.0
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_dombi.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
DombiTSKRegressorModel
Bases: BaseTSKRegressorModel
TSK regressor with a fixed Dombi T-norm in the antecedent.
DombiTSK extends TSK fuzzy inference by using a Dombi t-norm aggregation in antecedent evaluation while keeping first-order linear consequents.
Reference
G. Xue, L. Hu, J. Wang and S. Ablameyko, "ADMTSK: A High-Dimensional Takagi-Sugeno-Kang Fuzzy System Based on Adaptive Dombi T-Norm," in IEEE Transactions on Fuzzy Systems, vol. 33, no. 6, pp. 1767-1780, June 2025, doi: 10.1109/TFUZZ.2025.3535640.
Initialise the Dombi TSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
T-norm name or callable (default |
'dombi'
|
lambda_
|
float
|
Dombi parameter |
1.0
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_dombi.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
FSREADATSKClassifierModel
Bases: BaseTSKClassifierModel
FSRE-ADATSK classifier with adaptive softmin antecedent and gated consequents.
FSRE-ADATSK (Feature Selection and Rule Extraction) extends ADATSK.
Reference
G. Xue, Q. Chang, J. Wang, K. Zhang and N. R. Pal, "An Adaptive Neuro-Fuzzy System With Integrated Feature Selection and Rule Extraction for High-Dimensional Classification Problems," in IEEE Transactions on Fuzzy Systems, vol. 31, no. 7, pp. 2167-2181, July 2023, doi: 10.1109/TFUZZ.2022.3220950.
Initialise the FSRE-ADATSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices; ignored when
|
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon for the Ada-softmin operator. |
None
|
use_en_frb
|
bool
|
Start directly from the Enhanced FRB (En-FRB) instead of CoCo-FRB. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_fsre.py
expand_to_en_frb
Switch the rule layer to an Enhanced Fuzzy Rule Base for RE phase.
Source code in highfis/models/_fsre.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
fit_finetune
Fine-tune with no gates — plain TSK consequent (eq. 5).
fit_fs
Train the FS phase: only feature gates M(λ_d) are active (eq. 21).
fit_re
Expand to En-FRB and train the RE phase: only rule gates M(θ_r) active (eq. 22).
Source code in highfis/models/_fsre.py
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
FSREADATSKRegressorModel
Bases: BaseTSKRegressorModel
FSRE-ADATSK regressor with adaptive softmin antecedent and gated consequents.
FSRE-ADATSK (Feature Selection and Rule Extraction) extends ADATSK.
Reference
G. Xue, Q. Chang, J. Wang, K. Zhang and N. R. Pal, "An Adaptive Neuro-Fuzzy System With Integrated Feature Selection and Rule Extraction for High-Dimensional Classification Problems," in IEEE Transactions on Fuzzy Systems, vol. 31, no. 7, pp. 2167-2181, July 2023, doi: 10.1109/TFUZZ.2022.3220950.
Initialise the FSRE-ADATSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'coco'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices; ignored when
|
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
eps
|
float | None
|
Numerical stability epsilon for the Ada-softmin operator. |
None
|
use_en_frb
|
bool
|
Start directly from the Enhanced FRB (En-FRB). |
False
|
Source code in highfis/models/_fsre.py
expand_to_en_frb
Switch the rule layer to an Enhanced Fuzzy Rule Base for RE phase.
Source code in highfis/models/_fsre.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
fit_finetune
Fine-tune with no gates — plain TSK consequent (eq. 5).
fit_fs
Train the FS phase: only feature gates M(λ_d) are active (eq. 21).
fit_re
Expand to En-FRB and train the RE phase: only rule gates M(θ_r) active (eq. 22).
Source code in highfis/models/_fsre.py
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
HDFISMinClassifierModel
Bases: BaseTSKClassifierModel
HDFIS-min classifier with frozen antecedents and minimum aggregation.
HDFIS-min uses the minimum T-norm in the antecedent and only optimizes consequent parameters, which avoids the nondifferentiability of the minimum operator during training.
References
G. Xue, J. Wang, K. Zhang and N. R. Pal, "High-Dimensional Fuzzy Inference Systems," in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 54, no. 1, pp. 507-519, Jan. 2024, doi: 10.1109/TSMC.2023.3311475.
Initialize the HDFIS-min classifier.
Source code in highfis/models/_hdfis.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
HDFISMinRegressorModel
Bases: BaseTSKRegressorModel
HDFIS-min regressor with frozen antecedents and minimum aggregation.
HDFIS-min uses the minimum T-norm in the antecedent and only optimizes consequent parameters, which avoids the nondifferentiability of the minimum operator during training.
References
G. Xue, J. Wang, K. Zhang and N. R. Pal, "High-Dimensional Fuzzy Inference Systems," in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 54, no. 1, pp. 507-519, Jan. 2024, doi: 10.1109/TSMC.2023.3311475.
Initialize the HDFIS-min regressor.
Source code in highfis/models/_hdfis.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
HDFISProdClassifierModel
Bases: BaseTSKClassifierModel
HDFIS-prod classifier with dimension-dependent Gaussian MFs.
HDFIS-prod combines the standard product T-norm with a dimension-dependent Gaussian membership function (DMF) to avoid numeric underflow in very high-dimensional feature spaces while preserving first-order TSK consequents.
References
G. Xue, J. Wang, K. Zhang and N. R. Pal, "High-Dimensional Fuzzy Inference Systems," in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 54, no. 1, pp. 507-519, Jan. 2024, doi: 10.1109/TSMC.2023.3311475.
Initialize the HDFIS-prod classifier.
Source code in highfis/models/_hdfis.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
HDFISProdRegressorModel
Bases: BaseTSKRegressorModel
HDFIS-prod regressor with dimension-dependent Gaussian MFs.
HDFIS-prod combines the standard product T-norm with a dimension-dependent Gaussian membership function (DMF) to avoid numeric underflow in very high-dimensional feature spaces while preserving first-order TSK consequents.
References
G. Xue, J. Wang, K. Zhang and N. R. Pal, "High-Dimensional Fuzzy Inference Systems," in IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 54, no. 1, pp. 507-519, Jan. 2024, doi: 10.1109/TSMC.2023.3311475.
Initialize the HDFIS-prod regressor.
Source code in highfis/models/_hdfis.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
HTSKClassifierModel
Bases: BaseTSKClassifierModel
HTSK classifier for high-dimensional TSK inference.
HTSK replaces the standard product t-norm with a geometric mean over membership values and performs rule normalization in log-space.
References
Y. Cui, D. Wu and Y. Xu, "Curse of Dimensionality for TSK Fuzzy Neural Networks: Explanation and Solutions," 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China, 2021, pp. 1-8, doi: 10.1109/IJCNN52387.2021.9534265.
Initialise the HTSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
Antecedent aggregation operator name or callable
(default |
'gmean'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. If |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier module. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Apply batch normalisation to the consequent layer inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_htsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
HTSKRegressorModel
Bases: BaseTSKRegressorModel
HTSK regressor for high-dimensional TSK inference.
HTSK replaces the standard product t-norm with a geometric mean over membership values and performs rule normalization in log-space.
References
Y. Cui, D. Wu and Y. Xu, "Curse of Dimensionality for TSK Fuzzy Neural Networks: Explanation and Solutions," 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China, 2021, pp. 1-8, doi: 10.1109/IJCNN52387.2021.9534265.
Initialise the HTSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
Antecedent aggregation operator (default |
'gmean'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Source code in highfis/models/_htsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
LogTSKClassifierModel
Bases: BaseTSKClassifierModel
LogTSK classifier with inverse-log normalization of log-domain rules.
Firing strengths are normalized using the inverse-log formula, which is immune to softmax saturation in high-dimensional input spaces.
References
Y. Cui, D. Wu and Y. Xu, "Curse of Dimensionality for TSK Fuzzy Neural Networks: Explanation and Solutions," 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China, 2021, pp. 1-8, doi: 10.1109/IJCNN52387.2021.9534265.
Initialise the LogTSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
Antecedent aggregation operator (default |
'gmean'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_logtsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
LogTSKRegressorModel
Bases: BaseTSKRegressorModel
LogTSK regressor with inverse-log normalization of log-domain rules.
Firing strengths are normalized using the inverse-log formula, which is immune to softmax saturation in high-dimensional input spaces.
References
Y. Cui, D. Wu and Y. Xu, "Curse of Dimensionality for TSK Fuzzy Neural Networks: Explanation and Solutions," 2021 International Joint Conference on Neural Networks (IJCNN), Shenzhen, China, 2021, pp. 1-8, doi: 10.1109/IJCNN52387.2021.9534265.
Initialise the LogTSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
Antecedent aggregation operator (default |
'gmean'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Source code in highfis/models/_logtsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
MHTSKClassifierModel
Bases: BaseTSKClassifierModel
Multihead TSK classifier with sparse rule consequents.
MHTSK builds multiple sparse subantecedents from random feature subsets and jointly optimizes their rule consequents.
Reference
Z. Bian, Q. Chang, J. Wang and N. R. Pal, "Multihead Takagi-Sugeno-Kang Fuzzy System," in IEEE Transactions on Fuzzy Systems, vol. 33, no. 8, pp. 2561-2573, Aug. 2025, doi: 10.1109/TFUZZ.2025.3569227.
Initialize the MHTSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of membership functions. |
required |
rule_feature_mask
|
Tensor
|
Boolean tensor of shape (n_rules, n_inputs) indicating which features are active for each rule. |
required |
rules
|
Sequence[Sequence[int]]
|
Explicit per-rule MF index sequences for all inputs. |
required |
n_classes
|
int
|
Number of output classes. |
required |
t_norm
|
str | TNormFn
|
Antecedent aggregation operator (default |
'prod'
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Source code in highfis/models/_mhtsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
MHTSKRegressorModel
Bases: BaseTSKRegressorModel
Multihead TSK regressor with sparse rule consequents.
MHTSK builds multiple sparse subantecedents from random feature subsets and jointly optimizes their rule consequents.
Reference
Z. Bian, Q. Chang, J. Wang and N. R. Pal, "Multihead Takagi-Sugeno-Kang Fuzzy System," in IEEE Transactions on Fuzzy Systems, vol. 33, no. 8, pp. 2561-2573, Aug. 2025, doi: 10.1109/TFUZZ.2025.3569227.
Initialize the MHTSK regressor.
Source code in highfis/models/_mhtsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
TSKClassifierModel
Bases: BaseTSKClassifierModel
Vanilla TSK classifier with sum-based rule normalization.
The vanilla Takagi-Sugeno-Kang inference computes rule firing strengths with the product t-norm and normalizes them by their total sum.
References
T. Takagi and M. Sugeno, "Fuzzy identification of systems and its applications to modeling and control," in IEEE Transactions on Systems, Man, and Cybernetics, vol. SMC-15, no. 1, pp. 116-132, Jan.-Feb. 1985, doi: 10.1109/TSMC.1985.6313399.
Initialise the vanilla TSK classifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
n_classes
|
int
|
Number of output classes (must be ≥ 2). |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
Antecedent aggregation operator (default |
'prod'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in highfis/models/_htsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
predict
predict_proba
TSKRegressorModel
Bases: BaseTSKRegressorModel
Vanilla TSK regressor with sum-based rule normalization.
The vanilla Takagi-Sugeno-Kang inference computes rule firing strengths with the product t-norm and normalizes them by their total sum.
References
T. Takagi and M. Sugeno, "Fuzzy identification of systems and its applications to modeling and control," in IEEE Transactions on Systems, Man, and Cybernetics, vol. SMC-15, no. 1, pp. 116-132, Jan.-Feb. 1985, doi: 10.1109/TSMC.1985.6313399.
Initialise the vanilla TSK regressor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_mfs
|
Mapping[str, Sequence[MembershipFunction]]
|
Mapping from feature name to a sequence of
:class: |
required |
rule_base
|
str
|
Rule-base construction strategy. |
'cartesian'
|
t_norm
|
str | TNormFn
|
Antecedent aggregation operator (default |
'prod'
|
rules
|
Sequence[Sequence[int]] | None
|
Explicit rule antecedent indices. |
None
|
defuzzifier
|
nn.Module | None
|
Custom defuzzifier. Defaults to
:class: |
None
|
consequent_batch_norm
|
bool
|
Batch normalisation on consequent inputs. |
False
|
Source code in highfis/models/_htsk.py
fit
Train the model with optional early stopping.
When x_val and y_val are provided the model evaluates a
task-specific metric (via :meth:_evaluate_validation) after every
epoch and applies early stopping when the metric has not improved for
patience consecutive epochs.
By default the best model weights from validation are restored when
restore_best=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Tensor
|
Training features of shape |
required |
y
|
Tensor
|
Training targets of shape |
required |
epochs
|
int
|
Maximum number of training epochs. |
200
|
learning_rate
|
float
|
Learning rate for the default AdamW optimizer. |
0.001
|
criterion
|
Callable[[Tensor, Tensor], Tensor] | None
|
Optional loss function. Defaults to
:meth: |
None
|
optimizer
|
torch.optim.Optimizer | None
|
Optional pre-built optimizer. When |
None
|
batch_size
|
int | None
|
Mini-batch size. |
None
|
shuffle
|
bool
|
If |
True
|
ur_weight
|
float
|
Non-negative weight for the uniform rule
regularization term. |
0.0
|
ur_target
|
float | None
|
Target uniform activation for UR. Must be in
|
None
|
verbose
|
bool | int
|
Verbosity level. |
False
|
x_val
|
Tensor | None
|
Optional validation features of shape
|
None
|
y_val
|
Tensor | None
|
Optional validation targets of shape |
None
|
patience
|
int | None
|
Number of consecutive epochs without improvement
before early stopping. Set to |
20
|
restore_best
|
bool
|
If |
True
|
weight_decay
|
float
|
L2 weight decay applied to consequent parameters by the default AdamW optimizer. |
1e-08
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
A dictionary with keys |
dict[str, Any]
|
containing per-epoch loss lists. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If shapes of x, y, x_val, or y_val are
incompatible, or if ur_weight < 0 or ur_target is
outside |
Source code in highfis/base.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 | |
forward
forward_antecedents
Compute normalized rule strengths from model antecedents.
get_consequent_weights
Return the consequent layer weights or None when unavailable.
get_mf_params
Return a serializable description of the model's membership functions.
Source code in highfis/base.py
get_rule_table
Return the rule base as a table of feature-to-MF indices.
Source code in highfis/base.py
build_rule_feature_mask
Build a boolean mask indicating which features are active in each rule.