Different svd results with R2015b and R2016a

2 visualizzazioni (ultimi 30 giorni)
I'm trying to figure out why I'm seeing different results with the same code for R2015b and R2016a on Windows and Linux. Mac 2015b and R2016a match R2015b on Windows and Linux. Windows and Linux R2016a results match.
Any ideas on where to look to figure out why I'm getting different results?
>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 8.6.0.267246 (R2015b)
MATLAB License Number: XXXXXXX
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 10586)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 8.6 (R2015b)
Database Toolbox Version 6.0 (R2015b)
MATLAB Compiler Version 6.1 (R2015b)
Optimization Toolbox Version 7.3 (R2015b)
Parallel Computing Toolbox Version 6.7 (R2015b)
Statistics and Machine Learning Toolbox Version 10.1 (R2015b)
>> ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.0.0.341360 (R2016a)
MATLAB License Number: XXXXXXX
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 10586)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 9.0 (R2016a)
Database Toolbox Version 6.1 (R2016a)
MATLAB Compiler Version 6.2 (R2016a)
Optimization Toolbox Version 7.4 (R2016a)
Parallel Computing Toolbox Version 6.8 (R2016a)
Statistics and Machine Learning Toolbox Version 10.2 (R2016a)
  3 Commenti
Cameron Taggart
Cameron Taggart il 26 Mag 2016
After a few hours of debugging, I've narrowed it down to: http://www.mathworks.com/help/matlab/ref/svd.html

Accedi per commentare.

Risposta accettata

Christine Tobler
Christine Tobler il 27 Mag 2016
Spostato: Cris LaPierre il 10 Set 2024
Both results are correct up to machine precision. The reason for the difference between MATLAB versions is that the MKL library (containing the BLAS and LAPACK libraries which are used for the linear algebra computations) has been updated between releases.
To check the version of the MKL used in MATLAB, type
>> version -blas
The reason that the results changed is likely due to a difference in the order of operations. This will affect the results in small ways, without there necessarily being a better or worse result. Such small changes are likely to happen between any two MATLAB versions, as the MKL version is updated regularly.
  2 Commenti
Cameron Taggart
Cameron Taggart il 26 Mag 2016
Spostato: Cris LaPierre il 10 Set 2024
Why don't these produce the same results? Is one correct and the other not?
R2015b
>> format long;
m = [ 0.020000000000000 3.162340905089140 5.099058736668955 5.000039999840001; ...
3.162340905089140 0.020000000000000 8.246235504762158 5.000039999840001; ...
5.099058736668955 8.246235504762158 0.020000000000000 8.544027153514904; ...
5.000039999840001 5.000039999840001 8.544027153514904 0.020000000000000; ];
svd(m)
ans =
17.972498059668290
9.629925976510560
5.567459858959232
2.695112224198502
R2016a
>> format long;
m = [ 0.020000000000000 3.162340905089140 5.099058736668955 5.000039999840001; ...
3.162340905089140 0.020000000000000 8.246235504762158 5.000039999840001; ...
5.099058736668955 8.246235504762158 0.020000000000000 8.544027153514904; ...
5.000039999840001 5.000039999840001 8.544027153514904 0.020000000000000; ];
svd(m)
ans =
17.972498059668293
9.629925976510558
5.567459858959231
2.695112224198502
Cameron Taggart
Cameron Taggart il 31 Mag 2016
Spostato: Walter Roberson il 11 Set 2024
Thanks Christine! This makes sense.
For my notes, `version -blas`
R2015b Mac
Intel® Math Kernel Library Version 11.1.1 Product Build 20131010 for Intel® 64 architecture applications
R2016a Mac
Intel® Math Kernel Library Version 11.2.3 Product Build 20150409 for Intel® 64 architecture applications, CNR branch AVX2
R2015b Windows
Intel® Math Kernel Library Version 11.1.1 Product Build 20131010 for Intel® 64 architecture applications
R2016a Windows
Intel® Math Kernel Library Version 11.2.3 Product Build 20150413 for Intel® 64 architecture applications, CNR branch AVX2

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Parallel Computing Fundamentals in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by