Skip to content

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

Description

@Aguther70

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions