Skip to content

Squared singular values in calculation of variance#58

Open
axla-io wants to merge 2 commits into
mainfrom
al/sv-squared-fix
Open

Squared singular values in calculation of variance#58
axla-io wants to merge 2 commits into
mainfrom
al/sv-squared-fix

Conversation

@axla-io

@axla-io axla-io commented Mar 25, 2025

Copy link
Copy Markdown
Collaborator

Hi @dreamer2368 , I'm back!

Similar to llnl/libROM#306 this PR is a fix so that we use the squared singular values for the energy fraction calculation.

Example:

cd examples/poisson
../../bin/main -i poisson.full.yml -f main/mode=sample_generation

nb=1 # Number of bases in ROM

# Previous behavior
../../bin/main -i poisson.full.yml -f main/mode=train_rom:basis/svd/square_sv=false:basis/tags/0/number_of_basis=$nb:basis/tags/1/number_of_basis=$nb:basis/tags/2/number_of_basis=$nb:basis/tags/3/number_of_basis=$nb

# Current behavior
../../bin/main -i poisson.full.yml -f main/mode=train_rom:basis/tags/0/number_of_basis=$nb:basis/tags/1/number_of_basis=$nb:basis/tags/2/number_of_basis=$nb:basis/tags/3/number_of_basis=$nb

On my local device, the first training prints:

Singular values: 2.103E-01      1.928E-01       3.835E-02       8.536E-03       5.104E-04
Energy fraction with 1 basis: 46.6832645%
Creating file: poisson0_square-circle.000000
Singular values: 2.858E-01      1.391E-01       2.535E-02       2.736E-03       1.710E-04
Energy fraction with 1 basis: 63.0686903%
Creating file: poisson0_square-square.000000
Singular values: 3.545E-01      3.122E-01       6.106E-02       1.244E-02       6.307E-04
Energy fraction with 1 basis: 47.8501513%
Creating file: poisson0_square-star.000000
Singular values: 3.396E-01      3.038E-01       8.137E-02       2.957E-02       1.826E-03
Energy fraction with 1 basis: 44.9135469%

And the second one prints:

Singular values: 2.103E-01      1.928E-01       3.835E-02       8.536E-03       5.104E-04
Energy fraction with 1 basis: 53.3251752%
Creating file: poisson0_square-circle.000000
Singular values: 2.858E-01      1.391E-01       2.535E-02       2.736E-03       1.710E-04
Energy fraction with 1 basis: 80.3314430%
Creating file: poisson0_square-square.000000
Singular values: 3.545E-01      3.122E-01       6.106E-02       1.244E-02       6.307E-04
Energy fraction with 1 basis: 55.3531120%
Creating file: poisson0_square-star.000000
Singular values: 3.396E-01      3.038E-01       8.137E-02       2.957E-02       1.826E-03
Energy fraction with 1 basis: 53.6178019%

Let me know if you have any comments!

Best,
Axel

@axla-io axla-io requested a review from dreamer2368 March 25, 2025 04:07
* minor fix

* auxiliary train rom as a separate mode

* time checking and minor change. still work in progress.

* bug fix on SteadyNSSolver::LoadEQPElems

* default option for number of supremizer

* fixed bug for supremizer basis size

* option for interface eqp tolerance

* TimeProfiler class

* used time profile in rom interface form

* used time profiler in interface form

* ROMNonlinearForm::GetGradient uses TimeProfiler.

* time profiling on rom nonlinear form

* rom interface form time profiling

* time profiling in DGLaxFriedrichsFluxIntegrator

* PrintEQPCoords mode

* interface time profiling.

* steady NS time profiling

* reflecting dylans comments.

* bug/warning fixes.

* TimeProfile now possesses its own title. At its destruction, it prints with its title.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants