idaes-pse icon indicating copy to clipboard operation
idaes-pse copied to clipboard

Keras surrogate pruning and sparsification utilities

Open joshuahaddad opened this issue 2 years ago • 4 comments

Fixes

NA

Summary/Motivation:

These changes provide utility functions which allow the user to create pruning and sparsification routines for keras surrogates.

Changes proposed in this PR:

  • Addition of pruning utility file prune.py and tests
  • Addition of sparsification utility file sparsify.py and tests
  • Organization structure moving keras_surrogate.py from surrogate directory to surrogate/keras directory

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

joshuahaddad avatar Mar 16 '22 00:03 joshuahaddad

@joshuahaddad, I think you'll need to get the tests passing before getting reviews on this...

ksbeattie avatar Apr 14 '22 18:04 ksbeattie

Codecov Report

Merging #751 (9476034) into main (c760405) will increase coverage by 0.00%. The diff coverage is 93.00%.

@@           Coverage Diff           @@
##             main     #751   +/-   ##
=======================================
  Coverage   68.19%   68.19%           
=======================================
  Files         568      555   -13     
  Lines       62090    62130   +40     
  Branches    11475    11498   +23     
=======================================
+ Hits        42342    42372   +30     
- Misses      17572    17580    +8     
- Partials     2176     2178    +2     
Impacted Files Coverage Δ
idaes/core/surrogate/keras/sparsify.py 87.50% <87.50%> (ø)
idaes/core/surrogate/keras/prune.py 95.58% <95.58%> (ø)
idaes/ver.py 61.53% <0.00%> (-4.62%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c760405...9476034. Read the comment docs.

codecov[bot] avatar Apr 14 '22 22:04 codecov[bot]

Accidentally clicked close with comment while replying to Carl…

@ksbeattie tests are fixed and I will set up a meeting with Carl to discuss merging.

joshuahaddad avatar Apr 14 '22 23:04 joshuahaddad

@joshuahaddad The restructuring of the surrogates code that @carldlaird mentioned has just been completed in PR #808, so you are going to see a lot of conflicts in this PR now. I would echo Carl's suggestion that we close this and open a new PR.

andrewlee94 avatar Apr 19 '22 13:04 andrewlee94

This has not seen any action for months, so I am closing it for now. This can be reopened once it is ready to be looked at again.

andrewlee94 avatar Nov 14 '22 13:11 andrewlee94