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

optimization_dict not improving performance #7

Closed
maniospas opened this issue Aug 25, 2021 · 1 comment
Closed

optimization_dict not improving performance #7

maniospas opened this issue Aug 25, 2021 · 1 comment
Assignees
Labels
bug Something isn't working fixed

Comments

@maniospas
Copy link
Collaborator

The optimization_dict argument to the ClosedFormGraphFilter class does not seem to produce as an improvement in runnng time. This could indicate either a bug or bottlenecks in other parts of the pipeline, e.g. in graph signal instantiation.

Version: run with version 2.3 adjusted to run experiments 50 times when measuring time

Demonstration:

>>> import pygrank as pg
>>> optimization_dict = dict()
>>> pg.benchmark_print(pg.benchmark({"HK": pg.HeatKernel(optimization_dict=optimization_dict)}, pg.load_datasets_all_communities(["bigraph"]), metric="time"))
               	 HK 
bigraph0       	 3.06
bigraph1       	 3.36
>>> pg.benchmark_print(pg.benchmark({"HK": pg.HeatKernel()}, pg.load_datasets_all_communities(["bigraph"]), metric="time"))
               	 HK 
bigraph0       	 2.98
bigraph1       	 2.96

Related tests: None

@maniospas maniospas added the bug Something isn't working label Aug 25, 2021
@maniospas maniospas self-assigned this Aug 25, 2021
@maniospas
Copy link
Collaborator Author

Issue arose from creating a new personalization object in the GraphFilter.rank(...) method that had a different hash value than the original and hence could not be queries. This was fixed with a GraphFilter_prepare(personalization) method at the very beginning of ranking, which gives the opportunity to the ClosedFormGraphFilter to search for the dictionary entry with the true hash value.

Optimization improvements are tested only on the numpy backend, because in other backends running times are dominated by switching back-and-forth with numpy during supervised measure evaluation.

When fixing this issue, it was noted that GraphSignal.filter often dominates running time due to employing list comprehension instead of native backend operations. Respective operations were added to all backends.

Minimum fixed version: 0.2.5
Related tests: tests.test_filters.test_optimization_dict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

1 participant