-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add capability to handle interdependent functions in samplers/optimizers #2319
Conversation
@@ -0,0 +1,154 @@ | |||
<?xml version="1.0" ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jimmy-INL This is the show case/example you asked about.
@wangcj05 @joshua-cogliati-inl @mandd Unfortunately new issue
|
…he Model sections
Job Mingw Test on 74e6708 : invalidated by @alfoa |
@wangcj05 @joshua-cogliati-inl the windows machine seems to be down since days. Can we merge this without that test? |
Job Mingw Test on 0fd2726 : invalidated by @wangcj05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments for you to consider. @alfoa
Method to evaluate the function execution order using graph theory | ||
The order is stored in self.variableFunctionExecutionList |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two lines need to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
#self.ensembleModelGraph = graphStructure.graphObject(modelsToOutputModels) | ||
self.ensembleModelGraph = modelsGraph #graphStructure.graphObject(modelsToOutputModels) | ||
# make some checks | ||
if not self.ensembleModelGraph.isConnectedNet(): | ||
isolatedModels = self.ensembleModelGraph.findIsolatedVertices() | ||
self.raiseAnError(IOError, "Some models are not connected. Possible candidates are: "+' '.join(isolatedModels)) | ||
# get all paths | ||
allPath = self.ensembleModelGraph.findAllUniquePaths(self.initialStartModels) | ||
#allPath = self.ensembleModelGraph.findAllUniquePaths(self.initialStartModels) | ||
################################################### | ||
# to be removed once executionList can be handled # | ||
self.orderList = self.ensembleModelGraph.createSingleListOfVertices(allPath) | ||
#self.ensembleModelGraph.createSingleListOfVertices(allPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to keep the commented lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Job Mingw Test on 0fd2726 : invalidated by @joshua-cogliati-inl restarted civet |
1 similar comment
Job Mingw Test on 0fd2726 : invalidated by @joshua-cogliati-inl restarted civet |
Job Mingw Test on 0fd2726 : invalidated by @alfoa |
@wangcj05 @joshua-cogliati-inl Unfortunately windows machine still has issues... (now with the set environment). |
Job Mingw Test on 62194cc : invalidated by @joshua-cogliati-inl failed trying to download icu-73.2-h63175ca_0.conda |
Job Mingw Test on 62194cc : invalidated by @joshua-cogliati-inl updated conda |
Job Mingw Test on 7b55395 : invalidated by @joshua-cogliati-inl Failed in set python evnvironment (warning libmamba Could not parse mod/etag header) |
Is this good to be merged? @wangcj05 @joshua-cogliati-inl ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes are good.
PR is good, and checklist is satisfied. |
…ers (#2319) * moved samplers-optimizers function tests in their own folder for clarity * renamed * modified test names and revisions * moved subfolders * Closes #2302 * usage base class function evaluation method in ensembleForward * added error msg for detection of loop in function system * added test for ensemble model passing strings (restart file paths) around * removed trailing spaces * Update ravenframework/Samplers/EnsembleForward.py * Update ravenframework/Samplers/Sampler.py * Update ravenframework/Samplers/Sampler.py * Update ravenframework/Samplers/Sampler.py * fixed comment * we always check for isolated functions * updated model.tex * changed order to reflect order of appearance in the introduction of the Model sections * modified test description to make them latex compatible * specialization for EnsembleForward and CustomSampler * Apply suggestions from code review addressed Congjian's comments * Apply suggestions from code review * Apply suggestions from code review * Update ravenframework/Samplers/Sampler.py * updated setuptools dep * updated to simply ver 69 * added utility function as Congjian's request * plot entity * model order * added starting models * Apply suggestions from code review * Update ravenframework/utils/graphStructure.py --------- Co-authored-by: Congjian Wang - INL <congjian.wang@inl.gov>
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
Closes #2302
What are the significant changes in functionality due to this change request?
Added the possibility to specify in Optimizers/Samplers variables (defined through functions) that are interdependent.
For example, lets assume we sample the variables
#_Eggs
,grams_Pancetta_or_Guanciale(I know we should use only guanciale but it is difficult to find it)
,grams_Pecorino_Cheese
;#_tomatos
;the variable
what_dish_do_we_cook
depends solely on these variables (and it is defined through a RAVEN<function>
) and depending on the values of#_tomatos
and#_Eggs
the result of this function can be either beCarbonara
orAmatriciana
.the variable
which_pasta_should_we_use
depends on the variablewhat_dish_do_we_cook
:if
what_dish_do_we_cook
==Carbonara
,which_pasta_should_we_use
==Rigatoni
else
what_dish_do_we_cook
==Amatriciana
,which_pasta_should_we_use
==Bucatini
Based on this example, RAVEN will first sample
#_Eggs
,grams_Pancetta_or_Guanciale
,grams_Pecorino_Cheese
and#_tomatos
; Then it evaluates the function that computes the variablewhat_dish_do_we_cook
and finally it computes the variablewhich_pasta_should_we_use
depending on thevalue of the variable
what_dish_do_we_cook
.In addition to this capability, also a new test for the ensemble model testing/showing how to use it to transfer
string
variables from a model to the other using RAVEN variables has been added.For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.