-
Notifications
You must be signed in to change notification settings - Fork 135
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
Closes #673 #674
Closes #673 #674
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.
In addition to the comment, I think we also need to add the unit tests for the marginal and inverse marginal distributions.
@@ -184,6 +184,15 @@ class BasicMultiDimensionalInverseWeight: public virtual BasicDistributionND | |||
return value; | |||
} | |||
|
|||
double marginal(double x, int dimension){ |
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.
docstring
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.
added
@@ -156,14 +156,16 @@ | |||
if (_cdf_provided){ | |||
throwError("BasicMultiDimensionalCartesianSpline Distribution error: inverseMarginal calculation not available if CDF provided"); | |||
}else{ | |||
value = _interpolator.splineCartesianInverseMarginal(f, dimension, 0.01); | |||
value = _interpolator.splineCartesianInverseMarginal(f, dimension, 1.e-6); |
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 remove the coded value, and add a variable to control that?
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.
yes this is the final plan
} | ||
}else | ||
throwError("BasicMultiDimensionalCartesianSpline Distribution error: CDF value for inverse marginal distribution is above 1.0"); | ||
|
||
return value; | ||
} | ||
|
||
|
||
|
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.
remove extra line?
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
framework/SupervisedLearning.py
Outdated
@@ -3229,6 +3229,15 @@ def __init__(self,messageHandler,**kwargs): | |||
if self.pivotParameterID not in self.target: | |||
self.raiseAnError(IOError,"The pivotParameter "+self.pivotParameterID+" must be part of the Target space!") | |||
|
|||
def __setstate__(self, newstate): |
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.
newstate or newState?
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.
fixed
Comments addressed + added unit test |
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.
minor comment, the docstring of variable
in marginalDistribution and inverseMarginalDistribuation, may need to add more informative statement, associate the variable id to the dimension in the nd distribution, which will be more clear for the future developer.
The unit test that you created is failed:
You may need to update your checked values. |
ok fixed unit test and better docstrings |
@ Out, None | ||
""" | ||
if abs(value - expected) > tol: | ||
diff = abs(value - expected) if not relative else abs(value - expected)/expected |
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.
check expected!=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.
done
Tests are failed, how do you determine the checked value for the unit tests? are they depend on running systems? |
Well....I am simply pushing the value I get from the mac... The correct value should be 0.5 but unfortunately since the hard-coded discretizations and tolerances I am not able to get it. |
Job Mingw Test on 805d030 : canceled by @alfoa the machine is super slow |
Job Mingw Test on 805d030 : invalidated by @alfoa |
1 similar comment
Job Mingw Test on 805d030 : invalidated by @alfoa |
Job Mingw Test on 805d030 : invalidated by @PaulTalbot-INL Invalidating due to civet restart with new libraries. |
Job Mingw Test on 805d030 : invalidated by @alfoa |
1 similar comment
Job Mingw Test on 805d030 : invalidated by @alfoa |
For the record, since we have to force library versions on Windows manually, until #668 merges the libraries will not pass on other MRs. Just as a reminder. |
Job Mingw Test on 805d030 : invalidated by @alfoa |
…to alfoa/issue673
@wangcj05 can you review this again? It should be green now |
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.
minor comments
try: | ||
os.mkdir(currentWorkingDirectory) | ||
except OSError: | ||
self.raiseAWarning('current working dir '+currentWorkingDirectory+' already exists, this might imply deletion of present files') | ||
self.raiseAWarning('current working dir '+currentWorkingDirectory+' already exists, ' + | ||
'this might imply deletion of present files') |
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.
better to use ,
instead of +
, but it is fine if not change it.
self.raiseAWarning('As prescribed in the input, trying to re-submit the job "'+ | ||
finishedJob.identifier+'". Trial '+ | ||
str(self.failureHandling['jobRepetitionPerformed'][finishedJob.identifier]) + | ||
'/'+str(self.failureHandling['repetitions'])) |
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.
ok here, but better to use ,
self.failureHandling['jobRepetitionPerformed'][finishedJob.identifier] += 1 | ||
else: | ||
#add run to a pool that can be sent to the sampler later | ||
self.failedRuns.append(copy.copy(finishedJob)) | ||
self.raiseAWarning('The job "'+finishedJob.identifier+'" has been submitted '+ str(self.failureHandling['repetitions'])+' times, failing all the times!!!') | ||
self.raiseAWarning('The job "'+finishedJob.identifier+'" has been submitted '+ | ||
str(self.failureHandling['repetitions'])+' times, failing all the times!!!') |
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.
same as before
@@ -2210,6 +2210,9 @@ def __init__(self,messageHandler,**kwargs): | |||
""" | |||
supervisedLearning.__init__(self,messageHandler,**kwargs) | |||
name = self.initOptionDict.pop('name','') | |||
if 'pivotParameter' in self.initOptionDict: | |||
# remove pivot parameter if present | |||
self.initOptionDict.pop("pivotParameter") |
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 did not get here. You changed the way to retrieve the pivotParameter in the LearningGate
, but here you start to remove it. why?
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.
because the pivotParameter is needed internally for all the TimeDep ROMs, but not for the SKLearn ROMs., since we pass directly the dictionary into the SKL constructors (that complains in case a variable is not recognized (e.g. pivotParameter)
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.
Got it.
This PR looks good to me. I will go through the checklist. |
Proposed email: Dear users,
but in the manual they were called gainGrowthSize and gainShrinkSize. In addition:
The issues have been solved with the PR #674 and the modification is currently available in the devel branch |
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.
approved
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
Closes #673
Closes #695
Closes #583
Closes #697
What are the significant changes in functionality due to this change request?
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.Checklist review by @wangc on July 20, 2018