Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8735fb0

Browse files
authoredOct 30, 2024··
Update gaussian_fuzzyset.py
Fix membership method to return standard float type
1 parent 4cdeb39 commit 8735fb0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎fuzzy_logic/gaussian_fuzzyset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def membership(self, member: float) -> float:
6060

6161
membership_value = np.exp(-0.5 * ((member - self.mean) / self.std_dev) ** 2)
6262
# Directly return for non-complement or return 1 - membership for complement
63-
return membership_value if not self.is_complement else 1 - membership_value
63+
return float(membership_value) if not self.is_complement else 1 - float(membership_value)
6464

6565
def complement(self) -> GaussianFuzzySet:
6666
"""

0 commit comments

Comments
 (0)
Please sign in to comment.