-
Notifications
You must be signed in to change notification settings - Fork 54
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
Refractoring HAAQI #225
Comments
Hi @ns-rse, @jonbarker68 I've been trying to speed up the HAAQI code. In the code, we are using scipy which is not supported by numba but suppose to be faster than np.correlate for long signals. We can't just add
I tried to overwrite the numba's numpy.correlate
Thank you for your help. |
After the release of For example:
What are your thoughts? What else would you do to improve the metrics? |
These all seem like eminently sensible ideas @groadabike Obviously vectorising loops are going to offer good speed ups and restructuring into abstract classes are really useful. Has your profiling covered more than just numpy vs scipy for correlation? If not it might be worth using profiling against the code base to determine which areas might benefit most from careful refactoring. |
The profiling I am running evaluates the time of each function when running haaqi. clarity/clarity/evaluator/haspi/eb.py Line 1748 in 16e0472
|
In a quick review, I can see 5 possible classes
we could have a @ns-rse, how would you organise these classes? Below, I have 2 tables,
These have to be reimplemented in a way that doesn't affect the previous use. Table oneFunctions each metric is using
Table TwoConstructor Parameters
|
Hi @groadabike , I've not masses of experience with design patterns (I've no formal training in computer science so pick things up as I go along) and usually refer to Refactoring Guru when encountering them/needing to implement them. It sounds like you're proposing using Abstract Factory and so Another possible design pattern to use is Builder which allows construction of complex interfaces but they don't always have to the same construction processes, so maybe that would be preferable here given there are some differences in what each is required. Not sure if any of that helps at all I'm afraid. |
For reference, there is also a python HASPI translation here |
HAAQI refactoring was done in #364 |
Running HAAQI in full-length song is very slow.
This affects both tasks of this first round of Cadenza
The text was updated successfully, but these errors were encountered: