Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions xanfis/models/base_anfis.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ def __init__(self, input_dim=None, num_rules=None, output_dim=None, mf_class=Non
if validator.is_str_in_sequence(vanishing_strategy, self.SUPPORTED_VANISHING_STRATEGIES):
self.vanishing_strategy = vanishing_strategy
if self.vanishing_strategy == "prod":
self._get_strength = self.__get_strength_by_prod
self._get_strength = self._get_strength_by_prod
elif self.vanishing_strategy == "mean":
self._get_strength = self.__get_strength_by_mean
self._get_strength = self._get_strength_by_mean
else:
self._get_strength = self.__get_strength_by_blend
self._get_strength = self._get_strength_by_blend
else:
raise ValueError(f"Unsupported vanishing strategy: {vanishing_strategy}. Supported strategies are: {self.SUPPORTED_VANISHING_STRATEGIES}")

Expand Down Expand Up @@ -255,7 +255,7 @@ def _get_act(self, act_name):
else:
return getattr(nn.modules.activation, act_name)()

def __get_strength_by_mean(self, memberships):
def _get_strength_by_mean(self, memberships):
"""
Calculate the strengths of the rules using mean method.

Expand All @@ -268,7 +268,7 @@ def __get_strength_by_mean(self, memberships):
# Calculate strengths by taking the mean along the input dimension (dim=2)
return torch.mean(memberships, dim=2)

def __get_strength_by_prod(self, memberships):
def _get_strength_by_prod(self, memberships):
"""
Calculate the strengths of the rules using product method.

Expand All @@ -281,7 +281,7 @@ def __get_strength_by_prod(self, memberships):
# Calculate rule strengths by taking the product along the input dimension (dim=2)
return torch.prod(memberships, dim=2)

def __get_strength_by_blend(self, memberships):
def _get_strength_by_blend(self, memberships):
"""
Calculate the strengths of the rules using blend method.

Expand Down