-
Notifications
You must be signed in to change notification settings - Fork 137
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
Global TSA via ROMCollection #2189
Conversation
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 minor comments for consideration
Allows any global settings to be applied to the signal collected by the ROMCollection instance. | ||
Note this is called on the GLOBAL templateROM from the ROMcollection, NOT on the LOCAL supspace segment ROMs! | ||
@ In, evaluation, dict, {target: np.ndarray} evaluated full (global) signal from ROMCollection | ||
TODO finish docs |
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.
looks like there is a few input params left to finish: settings
, weights
, slicer
TODO finish docs | ||
@ Out, evaluation, dict, {target: np.ndarray} adjusted global evaluation | ||
""" | ||
if len(self._tsaGlobalAlgorithms)>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.
Should we raise a warning or error here if len(self._tsaGlobalAlgorithms) == 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.
this method is called in ROMCollection
in evaluate( )
and it seems like it was called regardless of whether a global or local algorithm was specified. the way I have it now, it just reports back the same evaluation if no global algorithms were specified so there shouldn't be an error as is
evaluation[key] = val | ||
return evaluation | ||
|
||
def finalizeLocalRomSegmentEvaluation(self, settings, evaluation, globalPicker, localPicker=None): |
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.
Is this a required method to satisfy some abstract method definition? Seems odd to just return the input evaluation
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.
I had overloaded the method from SupervisedLearning
because the inputs were different, but comparing with the finalizeLocalRomSegmentEvaluation( )
method in the SupervisedLearning.ARMA
it seems that the ARMA version just has an additional optional input that had not been updated in the parent version.
I am removing this method from SyntheticHistory.py
, updating the method in SupervisedLearning.py
with the additional optional input it is missing so that it functions as the "abstract/do nothing" parent method (since it also just returns evaluation
) for TSA
ravenframework/TSA/TSAUser.py
Outdated
@@ -95,6 +99,8 @@ def readTSAInput(self, spec): | |||
elif self.pivotParameterID not in self.target: | |||
# NOTE this assumes that every TSAUser is also an InputUser! | |||
raise IOError('TSA: The pivotParameter must be included in the target space.') | |||
if len(self._tsaAlgorithms)==0: | |||
print("No Segmenting algorithms were requested.") |
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 we have access to the messageHandler through this class? Perhaps we should self.raiseAWarning()
here instead of print.
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.
not in TSAUser
, but we have access in SyntheticHistory.py
. will move the check to handleInput
there
ravenframework/TSA/TSAUser.py
Outdated
@ In, evalGlobal, bool, are these algos trained on global signal? | ||
@ In, evaluation, dict, realization dictionary of values for each target | ||
@ In, slicer, list of slice, indexer for data range of this segment FROM GLOBAL SIGNAL | ||
@ Out, evaluation, dict, realization dictionary of values for each target |
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.
I think this should be called rlz
instead of evaluation
ravenframework/TSA/TSAUser.py
Outdated
rlz = dict((target, result[:, t]) for t, target in enumerate(noPivotTargets)) | ||
rlz[self.pivotParameterID] = self.pivotParameterValues | ||
if needToRecombine: | ||
# tmp_array = np.zeros((len(slicer), len(noPivotTargets))) |
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.
Leftover code
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
#2188
What are the significant changes in functionality due to this change request?
New attribute for TSA Algorithms for "global" which defaults to False. If true, that algorithm is added to a new
_tsaGlobalAlgorithms
list otherwise they are added to the original_tsaAlgorithms
. Calls to the normaltrain
andevaluate
withinTSAUser
have a new input to specify whether to use the local or global set of algorithms.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.