hillbig / redsvd Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/redsvd
Automatically exported from code.google.com/p/redsvd
What steps will reproduce the problem?
$ cat file1
1.0 2.0 3.0 4.0 5.0
-2.0 -1.0 0.0 1.0 2.0
1.0 -2.0 3.0 -5.0 7.0
$ redsvd -i file1 -o file1 -r 2 -f dense -m SymEigen && cat file1.*
compute SymEigen
read matrix from file1 ... -4.07454e-09 sec.
rows: 3
cols: 5
rank: 2
compute ... assertion "lhs.cols() == rhs.rows() && "invalid matrix product" &&
"if you wanted a coeff-wise or a dot product use the respective explicit
functions"" failed: file
"/usr/local/include/eigen3/Eigen/src/Core/ProductBase.h", line 103, function:
Eigen::ProductBase<Derived, Lhs, Rhs>::ProductBase(const Lhs&, const Rhs&)
[with Derived = Eigen::GeneralProduct<Eigen::Transpose<Eigen::Matrix<float,
-0x000000001, -0x000000001, 0, -0x000000001, -0x000000001> >,
Eigen::Matrix<float, -0x000000001, -0x000000001, 0, -0x000000001,
-0x000000001>, 5>, Lhs = Eigen::Transpose<Eigen::Matrix<float, -0x000000001,
-0x000000001, 0, -0x000000001, -0x000000001> >, Rhs = Eigen::Matrix<float,
-0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>]
Aborted (core dumped)
What is the expected output? What do you see instead?
計算結果が出力されてほしい
What version of the product are you using? On what operating system?
- Windows XP
- Cygwin 1.7
- redsvd 0.1.2
- eigen3 beta2
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Nov 2010 at 4:21
Hello,
I just tried to check that redsvd results are ok, so I created a matrix A using knows U,S and V and then decomposed A using redsvd.
The problem is that all the matrices created by redsvd are ok, except the fact that U is missing a column!
in order to run redsvd, I typed this caommand:
redsvd -i A.txt -o A -r 4 -f dense -m SVD
Here are the know matrices:
U (5,5)
0.870674 -0.260900 0.142705 -0.376696 0.107674
-0.263355 0.234090 0.650987 -0.362331 0.566373
0.233879 -0.126663 0.344914 0.846487 0.306189
0.093526 0.224747 -0.655580 0.016423 0.714624
0.330340 0.900321 0.084269 0.100038 -0.251373
S (5,4)
0.697420 0 0 0
0 0.583092 0 0
0 0 0.450462 0
0 0 0 0.095441
0 0 0 0
V (4,4)
0.5297211 -0.7870401 0.2261944 0.2209060
0.0391979 0.3837411 0.4654601 0.7965885
-0.8032730 -0.4206469 0.4216526 -0.0042134
0.2694653 0.2374170 0.7445751 -0.5626984
A (5,4) = U * S * V
0.447990 -0.033294 -0.396519 0.195602
-0.146030 0.154127 0.213913 0.220716
0.197523 0.114727 -0.034784 0.096643
-0.135040 -0.083363 -0.232047 -0.172076
-0.280437 0.235758 -0.389924 0.209609
And here are the results of redsvd:
calc_V (4,4)
-0.5297220 0.7870400 -0.2261940 0.2209060
-0.0391980 -0.3837420 -0.4654580 0.7965890
0.8032730 0.4206470 -0.4216530 -0.0042140
-0.2694650 -0.2374170 -0.7445760 -0.5626990
calc_s
0.697420
0.583092
0.450462
0.095441
calc_U (5,4)
-0.870674 0.260900 -0.142705 -0.376696
0.263355 -0.234090 -0.650987 -0.362331
-0.233879 0.126663 -0.344913 0.846487
-0.093526 -0.224746 0.655580 0.016422
-0.330340 -0.900321 -0.084269 0.100038
and the original U, again:
U (5,5)
0.870674 -0.260900 0.142705 -0.376696 0.107674
-0.263355 0.234090 0.650987 -0.362331 0.566373
0.233879 -0.126663 0.344914 0.846487 0.306189
0.093526 0.224747 -0.655580 0.016423 0.714624
0.330340 0.900321 0.084269 0.100038 -0.251373
What is wrong?
and by the way, the answer given by redsvd for U,V must be a square matrices. That's the theory behind!
A(m,n) = U (m,m) * S(m,n) * V'(n,n)
Thanks a lot!!
Oded
Hello,
I have these very large matrices and I'm trying to avoid to run JacobiSVD from Eigen. Therefore I am trying to run RedSVD. The problem is: my reconstruction error is huge when running RedSVD. I have no idea why. When I try RedSVD with a random matrix of same dimensions the reconstruction error is very small, so I guess it has something to do with my specific matrix.
I would really appreciate if you could give me some direction, since I exhausted my ideas. To showcase the problem I generated the smallest matrix I could that still presents a large reconstruction error, it can be accessed on this link. I also made the code that generates the error available here.
Thanks in advance.
What steps will reproduce the problem?
1.
>cat densa.txt
1.5 0.0 2.5 2.5
0.0 2.5 2.5 0.0
1.5 0.0 2.5 1.0
0.0 2.5 2.5 0.0
0.0 2.5 2.5 0.0
2.
redsvd -i densa.txt -o densa -f dense -r 10
3.
>cat densa.U
-0.401793 +0.706597 -0.582481 +0.000000
-0.486488 -0.308495 -0.038651 +0.000000
-0.358540 +0.463912 +0.810083 +0.000000
-0.486488 -0.308495 -0.038651 +0.000000
-0.486488 -0.308495 -0.038651 +0.000000
>cat densa.V
-0.165886 +0.472878 +0.409235 +0.000000
-0.530701 -0.623149 -0.347478 +0.000000
-0.807177 +0.164981 +0.334580 +0.000000
-0.198253 +0.600711 -0.774494 +0.000000
What is the expected output? What do you see instead?
First, I expected U to be 5 by 5.
Tried same matrix in gnu octave, and the first 3 column match exactly, but the
last one have values not zero:
octave-3.2.4:1> A=[1.5 0 2.5 2.5;0 2.5 2.5 0; 1.5 0 2.5 1.0; 0 2.5 2.5 0;0 2.5
2.5 0]
A =
1.50000 0.00000 2.50000 2.50000
0.00000 2.50000 2.50000 0.00000
1.50000 0.00000 2.50000 1.00000
0.00000 2.50000 2.50000 0.00000
0.00000 2.50000 2.50000 0.00000
octave-3.2.4:2> [u,s,v]=svd(A);
octave-3.2.4:3> u
u =
-4.0179e-01 7.0660e-01 5.8248e-01 1.9052e-16 -3.8365e-20
-4.8649e-01 -3.0849e-01 3.8651e-02 8.1650e-01 -1.2869e-16
-3.5854e-01 4.6391e-01 -8.1008e-01 -3.1762e-17 3.8365e-20
-4.8649e-01 -3.0849e-01 3.8651e-02 -4.0825e-01 -7.0711e-01
-4.8649e-01 -3.0849e-01 3.8651e-02 -4.0825e-01 7.0711e-01
octave-3.2.4:4> v
v =
-1.6589e-01 4.7288e-01 -4.0924e-01 7.6249e-01
-5.3070e-01 -6.2315e-01 3.4748e-01 4.5750e-01
-8.0718e-01 1.6498e-01 -3.3458e-01 -4.5750e-01
-1.9825e-01 6.0071e-01 7.7449e-01 1.1102e-16
What version of the product are you using? On what operating system?
Ubuntu 12.04
redsvd 0.2.0
Please provide any additional information below.
I don't sure it is an issue, I didn't find any other information to let me know
if this behavior is expected.
Original issue reported on code.google.com by [email protected]
on 27 Sep 2012 at 4:27
The following snippet won't compile.
Eigen::SparseMatrix<double> a(4, 5);
REDSVD::RedSVD svd(a, 2);
The precision of float is too low for some application.
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 8:07
問題
cygwin/gcc3.4.4
環境下でビルドしたredsvd0.1.2において、計算結果がnanになる
原因
sampleTwoGaussian(float&,float&): redsvd.cppにおいて、
float v1 = (float)(rand()) / ((float)RAND_MAX+1);
float v2 = (float)(rand()) / ((float)RAND_MAX+1);
float len = sqrt(-2.f * log(v1));
というコードがある。rand()の値域は0を含むが、v1に0が設定�
��れた場合lenがinfとなり以降の値がおかしくなる。
当該環境においては、srand()されていない場合、rand()を一回�
��に呼んだ時の初期値がかならず0となるため、常時計算結��
�がおかしくなることになる。
解決方法
rand()が0を返す場合を考慮する。
知識不足でパッチは書けませんでした。
以上よろしくお願いします。
Original issue reported on code.google.com by [email protected]
on 15 Nov 2010 at 6:48
What steps will reproduce the problem?
$ cat file1
1.0 2.0 3.0 4.0 5.0
-2.0 -1.0 0.0 1.0 2.0
1.0 -2.0 3.0 -5.0 7.0
$ redsvd -i file1 -o file1 -r 2 -f dense -m PCA && cat file1.*
compute PCA
read matrix from file1 ... -6.89179e-08 sec.
rows: 3
cols: 5
rank: 2
compute ... 3.49246e-09 sec.
write file1.pc
assertion "other.rows() == 1 || other.cols() == 1" failed: file
"/usr/local/include/eigen3/Eigen/src/Core/DenseStorageBase.h", line 247,
function: void Eigen::DenseStorageBase<Derived>::resizeLike(const
Eigen::EigenBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<float,
-0x000000001, -0x000000001, 0, -0x000000001, -0x000000001>, Derived =
Eigen::Matrix<float, -0x000000001, 1, 0, -0x000000001, 1>]
Aborted (core dumped)
What is the expected output? What do you see instead?
計算結果が出力されてほしい
What version of the product are you using? On what operating system?
- Windows XP
- Cygwin 1.7
- redsvd 0.1.2
- eigen3 beta2
Please provide any additional information below.
writeMatrix(const string& fn, const REDSVD::RedPCA& A) 内のwriteVector_(const
string& fn, const VectorXf& V)の呼び出しにおいて、MatrixXf
RedPCA#scores()をVectorXfに変換しようとするところで落ちている
ようです。
Original issue reported on code.google.com by [email protected]
on 16 Nov 2010 at 4:19
How can I use redsvd with visual studio?
Original issue reported on code.google.com by [email protected]
on 3 Nov 2011 at 8:53
What steps will reproduce the problem?
1. ./RedSVD.exe -i ip.mat -o op -r 2 -m SymEigen -f sparse
2. cat ip.mat
0:1 3:0.5
1:1
2:1
0:0.5 3:1
What is the expected output? What do you see instead?
Expected: since the matrix is sparse and there are rows with just 1 non-zero
value, I expect to see either eigen value of 1 or eigen vector with value at
index 1 and index 2 to be 0 (if counting indices from 0). Something like
x_0
0
0
x_3
I see this:
cat op.evec
+0.463004 -0.795740
-0.735242 -0.368169
+0.411030 -0.080414
-0.275864 -0.474113
cat op.eval
+0.872274
+1.377271
What version of the product are you using? On what operating system?
I am compiling the code in visual studio 2013. The versions are:
1. redsvd 0.2.0
2. Eigen 3
Please provide any additional information below.
If I provide identity matrix, I get the correct eigen values and vectors.
Adding 2 elements at some {i,j} and {j,i} location does not yield the correct
eigen vectors.
Am I missing something here ? Your help would be much appreciated. Thank you.
Original issue reported on code.google.com by [email protected]
on 27 Feb 2014 at 10:37
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.