[connect] Optimize the connector about ScaleFreeBA, ScaleFreeBADual, PowerLaw #412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add new test case for ProbDist in
test_random_conn.py
Create
test_all_time.py
to test the efficiency of all connectors and the results show that the following four connectors need to be optimized: ScaleFreeBA, ScaleFreeBADual, PowerLaw and ProbDist.Optimize ScaleFreeBA, ScaleFreeBADual, PowerLaw's build_conn function by by preallocating repeated_nodes with array of numpy and Rename their
build_conn
tobuild_mat
, also their returned values are changed accordinglyTry to optimize ProbDist, but if parallelization is performed, the results will be inconsistent which need to be solved in the future
Create
test_optimized_result.py
to compare the results and time needed between before and after optimized for GaussianProb, ScaleFreeBA, ScaleFreeBADual and PowerLawHow Has This Been Tested
Test device
Hardware
CPU: Intel Core i5-12490F 6C12T
GPU: Nvidia Geforce RTX 2070
RAM: 32G DDR4 3200MHz
Software
OS: Windows10 20H2
Python: 3.10
Below is the test result
<style> </style>