You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reporting here a subtle internal math bug for tracking only.
To be clear: this does not affect the convergence of the PCA: the PCA is still valid at the end once it converges :)
But, if you ask for N power iterations, the current clojure code does N+1 iterations instead. This is due to the way the loop is coded in clojure in:
The let statement is evaluated even when iters is 0.
And on line 55 we return normed upon termination, therefore the result of evaluating the let block.
If we wanted to fix it to do exactly iters iteration, and not iters+1, line 55 should return start-vector instead of normed.
I suggest we do NOT fix this this for now, until I have full clarity of how partial-pca is computed. It will most matter much when we use a small number of iteration.
Reporting here a subtle internal math bug for tracking only.
To be clear: this does not affect the convergence of the PCA: the PCA is still valid at the end once it converges :)
But, if you ask for N power iterations, the current clojure code does N+1 iterations instead. This is due to the way the loop is coded in clojure in:
polis/math/src/polismath/math/pca.clj
Lines 50 to 56 in 2ed917e
The
let
statement is evaluated even wheniters
is 0.And on line 55 we return
normed
upon termination, therefore the result of evaluating thelet
block.If we wanted to fix it to do exactly
iters
iteration, and notiters+1
, line 55 should returnstart-vector
instead ofnormed
.I suggest we do NOT fix this this for now, until I have full clarity of how
partial-pca
is computed. It will most matter much when we use a small number of iteration.I see that
polis/math/src/polismath/math/conversation.clj
Lines 703 to 708 in 2ed917e
defaults to 10 iterations, but I am unclear how often that default is used, knowing that
polis/math/src/polismath/math/conversation.clj
Lines 136 to 151 in 2ed917e
defines a default of 100.
As to the python port in #1893 , for now I am reproducing the behaviour bug-for-bug, see 47c217b .
The text was updated successfully, but these errors were encountered: