Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems executing preprocess_features(features) in train.py #223

Open
Aguther70 opened this issue Feb 17, 2024 · 0 comments
Open

Problems executing preprocess_features(features) in train.py #223

Aguther70 opened this issue Feb 17, 2024 · 0 comments

Comments

@Aguther70
Copy link

Hi, I´m having problems executing the function preprocess_features(features) in train.py.

def preprocess_features(features):
"""Row-normalize feature matrix and convert to tuple representation"""
rowsum = np.array(features.sum(1)) # <<<--- ERROR
r_inv = np.power(rowsum, -1).flatten()
r_inv[np.isinf(r_inv)] = 0.
r_mat_inv = sp.diags(r_inv)
features = r_mat_inv.dot(features)
return sparse_to_tuple(features)

The error is: 'tuple' object has no attribute 'sum'

Could somebody help me in solving this issue?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant