Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ezralazuardy committed Nov 15, 2024
1 parent 36c8054 commit 46f7aab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lazuardy_anfis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
- lazuardy-tech <[email protected]>
"""

from . import anfis, membershipfunction, mfderivs
from . import anfis, membershipfunction

__all__ = ["anfis", "membershipfunction", "mfderivs"]
__all__ = ["anfis", "membershipfunction"]
11 changes: 6 additions & 5 deletions lazuardy_anfis/anfis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import itertools

import numpy as np

from . import mfderivs
from skfuzzy import partial_dmf


class ANFIS:
Expand Down Expand Up @@ -271,10 +270,12 @@ def backprop(ANFISObj, columnX, columns, theWSum, theW, theLayerFive):
np.where(ANFISObj.rules[:, columnX] == MF)
)[0]
adjCols = np.delete(columns, columnX)

senSit = mfderivs.partial_dMF(
ANFISObj.X[rowX, columnX], ANFISObj.memFuncs[columnX][MF], alpha
mf_name = ANFISObj.memFuncs[columnX][MF][0]
mf_parameters = ANFISObj.memFuncs[columnX][MF][1]
senSit = partial_dmf(
ANFISObj.X[rowX, columnX], mf_name, mf_parameters, alpha
)

# produces d_ruleOutput/d_parameterWithinMF
dW_dAplha = senSit * np.array(
[
Expand Down
2 changes: 1 addition & 1 deletion lazuardy_anfis/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import numpy as np

from . import anfis, membershipfunction, mfderivs
from . import anfis, membershipfunction

# define the training_set.txt file path
training_set = os.getcwd() + "/lazuardy_anfis/training_set.txt"
Expand Down

0 comments on commit 46f7aab

Please sign in to comment.