possible loss of precision and Unable to run SVDLIBC or MATLAB SVD

53 views
Skip to first unread message

Ibtehal Baazeem

unread,
May 4, 2015, 6:10:54 AM5/4/15
to s-space-re...@googlegroups.com
Hi,

I've tried to assign:

//Properties for building the semantic space

Properties definedProp = new Properties();


definedProp.setProperty("edu.ucla.sspace.lsa.LatentSemanticAnalysis.svd.algorithm" , "ANY");


it works but it gives:

May 04, 2015 5:02:49 PM edu.ucla.sspace.matrix.MatrixIO matlabToSvdlibcSparseBinary

INFO: Converting from Matlab double values to SVDLIBC float values; possible loss of precision


my questions are:


1) Is this lost significant to the built semantic space?


2)How can I stop this conversion to avoid the lost of precesion?


3) I 've tried to choose SVDLIBC and MATLAB which are both installed in my device, but they haven't worked:


When running MATLAB:


May 04, 2015 4:53:10 PM edu.ucla.sspace.lsa.LatentSemanticAnalysis processSpace

INFO: performing TF-IDF transform

May 04, 2015 4:53:10 PM edu.ucla.sspace.lsa.LatentSemanticAnalysis processSpace

INFO: reducing to 300 dimensions

May 04, 2015 4:53:11 PM edu.ucla.sspace.matrix.SVD matlabSVDS

SEVERE: Matlab svds

java.io.IOException: Cannot run program "matlab": error=2, No such file or directory

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

at java.lang.Runtime.exec(Runtime.java:620)

at java.lang.Runtime.exec(Runtime.java:450)

at java.lang.Runtime.exec(Runtime.java:347)

at edu.ucla.sspace.matrix.SVD.matlabSVDS(SVD.java:1054)

at edu.ucla.sspace.matrix.SVD.svd(SVD.java:357)

at edu.ucla.sspace.lsa.LatentSemanticAnalysis.processSpace(LatentSemanticAnalysis.java:528)



When running SVDLIBC:

INFO: Converting from Matlab double values to SVDLIBC float values; possible loss of precision

May 04, 2015 5:06:47 PM edu.ucla.sspace.matrix.SVD svdlibc

SEVERE: SVDLIBC

java.io.IOException: Cannot run program "svd": error=2, No such file or directory

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

at java.lang.Runtime.exec(Runtime.java:620)

at java.lang.Runtime.exec(Runtime.java:450)

at java.lang.Runtime.exec(Runtime.java:347)

at edu.ucla.sspace.matrix.SVD.svdlibc(SVD.java:933)

at edu.ucla.sspace.matrix.SVD.svd(SVD.java:340)

at edu.ucla.sspace.lsa.LatentSemanticAnalysis.processSpace(LatentSemanticAnalysis.java:528)

at MySSpaceAlgorithm.buildSemanticSpace(MySSpaceAlgorithm.java:315)

at LSA_Expirements$ButtonClickListener.actionPerformed(LSA_Expirements.java:329)

at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)



4) I've tried JAMA also but it always has a problem with Heap space.


Many Thanks,


David Jurgens

unread,
May 4, 2015, 3:10:56 PM5/4/15
to s-space-re...@googlegroups.com
On Mon, May 4, 2015 at 3:09 AM, Ibtehal Baazeem <isba...@gmail.com> wrote:
Hi,

I've tried to assign:

//Properties for building the semantic space

Properties definedProp = new Properties();


definedProp.setProperty("edu.ucla.sspace.lsa.LatentSemanticAnalysis.svd.algorithm" , "ANY");


it works but it gives:

May 04, 2015 5:02:49 PM edu.ucla.sspace.matrix.MatrixIO matlabToSvdlibcSparseBinary

INFO: Converting from Matlab double values to SVDLIBC float values; possible loss of precision


my questions are:


1) Is this lost significant to the built semantic space?


No, it's just that we use double values internally and SVDLIBC uses float values.  That's should not cause significant differences in results, but we just report it in case it might be of interest.
 

2)How can I stop this conversion to avoid the lost of precesion?


You can use Matlab, which will run the SVD on double-precision floating point numbers.
 

3) I 've tried to choose SVDLIBC and MATLAB which are both installed in my device, but they haven't worked:


When running MATLAB:

java.io.IOException: Cannot run program "matlab": error=2, No such file or directory

When running SVDLIBC:

java.io.IOException: Cannot run program "svd": error=2, No such file or directory


Both of these error messages are indicating that neither Matlab nor SVDLIBC are installed and available on the command line.  What kind of system are you running (e.g., linux, or windows).  In order for the SVD code to work, you should be able to type "svd" or "matlab" on the command line and see that the appropriate program starts.

 

4) I've tried JAMA also but it always has a problem with Heap space.


Yes, this is a known issue with JAMA, which does a full SVD on dense matrices.  In the LSA case, we only need a thin SVD on sparse matrices, so JAMA requires far more memory than is needed.

  Thanks,
  David
 


Many Thanks,


--
You received this message because you are subscribed to the Google Groups "Semantic Space Research - Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to s-space-research...@googlegroups.com.
To post to this group, send email to s-space-re...@googlegroups.com.
Visit this group at http://groups.google.com/group/s-space-research-dev.
For more options, visit https://groups.google.com/d/optout.

Ibtehal Baazeem

unread,
May 9, 2015, 1:22:44 AM5/9/15
to s-space-re...@googlegroups.com

Dear David, 

Thank you so much for your answer. I've tried to export MATLAB path in the command line and it works.

Best Regards,
Reply all
Reply to author
Forward
0 new messages