10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-26 04:37:26 +02:00
This commit is contained in:
Anthony Scemama 2019-02-28 16:08:28 +01:00
parent 7a44c8bf64
commit 04caf1930c

View File

@ -4,7 +4,7 @@ type t
let make let make
?guess ?guess
?(n_states=8) ?(n_states=1)
?(n_iter=10) ?(n_iter=10)
?(threshold=1.e-6) ?(threshold=1.e-6)
diagonal diagonal
@ -37,7 +37,7 @@ let make
) )
|> Util.normalize |> Util.normalize
in in
List.init m (fun i -> random_vector i) List.init m (fun i -> random_vector (i+1))
in in
let pick_new u = let pick_new u =
@ -73,7 +73,7 @@ let make
matrix_prod ( matrix_prod (
u_new_ortho u_new_ortho
|> Mat.of_col_vecs_list |> Mat.of_col_vecs_list
|> Matrix.sparse_of_mat ) |> Matrix.dense_of_mat )
|> Matrix.to_mat |> Matrix.to_mat
|> Mat.to_col_vecs_list |> Mat.to_col_vecs_list
in in