-
Notifications
You must be signed in to change notification settings - Fork 3
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
FitMaker #49
Comments
I'll handle this. |
We will look into using DOT matrices instead. |
One can leverage solve in DOT.Matrix to do the heavy lifting. In this new implementation, all the heavy lifting is done by squareMatrix.solve( columnMatrix ); For the record, the previous implementation of FitMaker was not a performance bottleneck in the simulation.
Assigning to @pixelzoom to decide how to proceed. |
@veillette please clarify: (1) Is the code that you pasted into the above comment the new proposed implementation (which doesn't appear to be pushed to GitHub), or what you are referring to as "the previous implementation"? (2) Have you profiled the performance of the new implementation? Did you say "the previous implementation of FitMaker was not a performance bottleneck" because the new implementation is a bottleneck? |
Jonathan Olson's comment implied that using dot.Matrix might be a performance booster. The code I pasted above is the new implementation that makes uses of dot.Matrix and Matrix.solve. It simplifies the codebase. I did not push it to GitHub. So both approaches are equivalent mathematically (although dot matrix appears to use a different type of solver) The dot.matrix implementation generates three instances of Matrix for every getFit call so one might think that there would be more garbage collection events. However, on my laptop, I did not register any performance differences and the number of garbage collection events appears to be similar ( using fuzzMouse=100) |
If the results are the same, performance is the same or better, and there's less code, then I would opt for the new implementation. That said, I'm not at all familiar with FitMaker yet, so your call. |
The new implementation of fitMaker that relies on DOT was pushed. It will simplify a bit the codebase. Running fuzzMouse for five minutes does not reveal any issues. |
I believe this issue can be closed. Marking as ready for review. |
This issue is so old that its title refers to a module that no longer exists. The current method getBestFitCoefficients in Curve.js fulfills the same role as FitMaker. |
What type of fit does it do, minimizing least squares via linear regression? (This should be documented).
Besides creation of the specific type of augmented matrix used for the regression, it seems like it's duplicating code from dot's Matrix (ported from JAMA). Is there a benefit to having this re-implemented? (Is it doing anything besides just solving the augmented matrix?)
Also it may not be relevant, but if FitMaker is a performance bottleneck, the use of two-dimensional non-typed arrays, and repeated references to matrix element lookups could be optimized (dot uses one-dimensional typed arrays).
Review: #31
The text was updated successfully, but these errors were encountered: