Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEFECT] Genetic Algorithm doesn't recognize constants and functions #1665

Closed
10 tasks done
Jderrill opened this issue Sep 22, 2021 · 2 comments · Fixed by #1666
Closed
10 tasks done

[DEFECT] Genetic Algorithm doesn't recognize constants and functions #1665

Jderrill opened this issue Sep 22, 2021 · 2 comments · Fixed by #1666

Comments

@Jderrill
Copy link

Jderrill commented Sep 22, 2021


Defect Description

Genetic Algorithm optimizer doesn't recognize constants or functions.

What did you expect to see happen?

Expected the optimizer node to pass constants via multirun that could be accessed by an external model.

What did you see instead?

External model doesn't receive constants and throws an error when trying to access the constants.

Do you have a suggested fix for the development team?

Have GA send constants like gradient descent

Describe how to Reproduce
Steps to reproduce the behavior:

  1. Put constant node into genetic algorithm optimization node/ MC sampler node in any of the GA tests
  2. Have external model manipulate the constant
  3. Get error AttributeError: 'Object' object has no attribute '[constant name]'

Screenshots and Input Files
Please attach the input file(s) that generate this error. The simpler the input, the faster we can find the issue.

Added Constant:
image

Manipulated in external model:
image

Error:
image

Platform (please complete the following information):

  • OS: Windows
  • Version: [e.g. 22]
  • Dependencies Installation: CONDA

For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.

  • 1. Is it tagged with a type: defect or task?
  • 2. Is it tagged with a priority: critical, normal or minor?
  • 3. If it will impact requirements or requirements tests, is it tagged with requirements?
  • 4. If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • 5. Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.

  • 1. If the issue is a defect, is the defect fixed?
  • 2. If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • 3. If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)?
  • 4. If the issue is a defect, does it impact the latest release branch? If yes, is there any issue tagged with release (create if needed)?
  • 5. If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?
@wangcj05
Copy link
Collaborator

@aalfonsi can you send an email to the user regarding the fix for this issue in PR #1666?

wangcj05 pushed a commit that referenced this issue Sep 28, 2021
* Closes #1665

* modified test to test the constants

* fixed implicit constraints

* fix undefined variable

* fixed pb wg

* fix validation

* Removed commented line from GeneticAlgorithm.py

* Added <revisions> block for modified test

Co-authored-by: ANDREA ALFONSI <alfoa@ANDREAs-MacBook-Pro.local>
@aalfonsi
Copy link
Collaborator

@wangcj05 is this okay? if so, can you send it?
Dear users, An issue has been identified with the genetic algorithms. That optimizer did not accept constants, functions and correlated variables. As for PR #1666 (merged in the devel/master branches), the optimizer now behaves similarly to other optimizers and samplers.

wangcj05 pushed a commit that referenced this issue Oct 25, 2021
* Closes #1665

* removed clearRunDir

Co-authored-by: ANDREA ALFONSI <alfoa@ANDREAs-MacBook-Pro.local>
wangcj05 pushed a commit that referenced this issue Oct 29, 2021
* Closes #1493

* removed print statement

* minor other fixes

* restart civet

* Fixed issue #1520. Closes #1520

* Closes #1521

* fix

* Closes #1665

* Fixed GA failures in case of failures

* Update plugin_handler.py

* Update GradientDescent.py

* Update GradientDescent.py

* added failure

* Update GeneticAlgorithm.py

* Update MultiRun.py

added explanation

* Update failureOfRuns.xml

* for test

* making the failures random and adding the test to tests after regolding

* reverted files

* since the new ROM API, this pickled rom needed to be regenerated

* it seems that some of the user guide inputs did not get updated after ROM api update

* fixed Dataset


Co-authored-by: alfoa <andrea.alfonsi@inl.gov>
Co-authored-by: ANDREA ALFONSI <alfoa@ANDREAs-MacBook-Pro.local>
Co-authored-by: Jimmy-INL <52417034+Jimmy-INL@users.noreply.github.com>
wangcj05 pushed a commit that referenced this issue Nov 9, 2021
* added spearman

* fixed conversion script with current new hdf5 (no message handler)

* fix basic statistics

* fix conversion

* fix duplication

* Closes #1665

* removed commented code

* manual

* removed added test from other branch

* regolded since there were NaN in the gold file but now the NaN are filled with zeros

* fix bstat for nan

* added weighted spearman coefficients calculation

* added explaination of NaN

* updated test description

* added test in the test matrix

* commented out the HistorySet duplicated tackling

* added reference and manual updates

* added ref to theory manual

* moving spearman outside...draft

* fixed spearman addressing Congjian's commets

* reduced test to only spearman

* Update HistorySet.py

* Update BasicStatistics.py

Co-authored-by: mandd <diego.mandelli@inl.gov>
Co-authored-by: ANDREA ALFONSI <alfoa@ANDREAs-MacBook-Pro.local>
Co-authored-by: aalfonsi <andrea.alfonsi86@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants