Skip to content

Commit

Permalink
Merge pull request #197 from rahulnair23/master
Browse files Browse the repository at this point in the history
COFRNET - Minor fixes on binary incompatibility of numpy/pandas by pinning numpy version and explainer
  • Loading branch information
vijay-arya authored Feb 26, 2025
2 parents aea0342 + f7bcc72 commit 1ea7fc1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aix360/algorithms/cofrnet/CoFrNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def explain(self, explain_mode, max_layer_num = 10, var_num = 6):
var_num: For "print_co_fr": Variable (index of input feature) for Which to Display Ladder, Default 6
'''

def importances(self):
def importances():
final_layer_weights = vars(self.model.layers[-1])['_parameters']['weight'].data.numpy()
weights_by_node = final_layer_weights.T
averaged = np.average(weights_by_node, axis = 1)
Expand All @@ -144,7 +144,7 @@ def importances(self):
#print(vars(self.model.layers[-1])['_parameters']['weight'].data.numpy().T)


def print_co_fr(self, max_layer_num = 10, var_num = 6):
def print_co_fr(max_layer_num = 10, var_num = 6):
#max_layer_num = chosen depth of ladder to show (10 layers, index would be 9)
#var_num = variable for which to display ladder
thingToPrint = ""
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
],
"cofrnet": [
"pandas<2.0.0",
"numpy==1.24.2",
"torch",
"tqdm",
],
Expand Down

0 comments on commit 1ea7fc1

Please sign in to comment.