-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix scaling issue in DataSet when Grid sampler is used as restart. (#730
) * fix std in data comparison * add test to test restart with constant variables, test issue #690 * rename folder name, since 'con' is not acceptable in windows
- Loading branch information
Showing
5 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
x1,x2,ans | ||
1.0,2.0,1.0 | ||
2.0,2.0,1.0 |
10 changes: 10 additions & 0 deletions
10
tests/framework/Samplers/Restart/gold/constant/restart.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
x1,x2,ans | ||
1.0,2.0,1.0 | ||
1.0,2.5,2.0 | ||
1.0,3.0,2.0 | ||
1.5,2.0,2.0 | ||
1.5,2.5,2.0 | ||
1.5,3.0,2.0 | ||
2.0,2.0,1.0 | ||
2.0,2.5,2.0 | ||
2.0,3.0,2.0 |
113 changes: 113 additions & 0 deletions
113
tests/framework/Samplers/Restart/test_restart_constant.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0" ?> | ||
<Simulation verbosity="debug"> | ||
<TestInfo> | ||
<name>framework/Samplers/Restart.Constant</name> | ||
<author>wangc</author> | ||
<created>2018-08-04</created> | ||
<classesTested>Samplers.Grid</classesTested> | ||
<description> | ||
The essence of this test is to demonstrate the restart capability with constant variable, | ||
i.e. test the scaling factor for constant samples as mentioned in issue #690 | ||
</description> | ||
</TestInfo> | ||
|
||
<RunInfo> | ||
<WorkingDir>constant</WorkingDir> | ||
<Sequence>makeCoarse, makeFineRestart,print</Sequence> | ||
<batchSize>1</batchSize> | ||
</RunInfo> | ||
|
||
<Steps> | ||
<MultiRun name="makeCoarse"> | ||
<Input class="DataObjects" type="PointSet">dummyIN</Input> | ||
<Model class="Models" type="ExternalModel">coarsemod</Model> | ||
<Sampler class="Samplers" type="Grid">coarse</Sampler> | ||
<Output class="DataObjects" type="PointSet">solns</Output> | ||
</MultiRun> | ||
<MultiRun name="makeFineRestart"> | ||
<Input class="DataObjects" type="PointSet">solns</Input> | ||
<Model class="Models" type="ExternalModel">finemod</Model> | ||
<Sampler class="Samplers" type="Grid">fineRestart</Sampler> | ||
<Output class="DataObjects" type="PointSet">solnsRestart</Output> | ||
</MultiRun> | ||
<IOStep name="print"> | ||
<Input class="DataObjects" type="PointSet">solns</Input> | ||
<Input class="DataObjects" type="PointSet">solnsRestart</Input> | ||
<Output class="OutStreams" type="Print">coarse</Output> | ||
<Output class="OutStreams" type="Print">restart</Output> | ||
</IOStep> | ||
</Steps> | ||
|
||
<Distributions> | ||
<Uniform name="u1"> | ||
<lowerBound>1</lowerBound> | ||
<upperBound>2</upperBound> | ||
</Uniform> | ||
<Uniform name="u2"> | ||
<lowerBound>2</lowerBound> | ||
<upperBound>3</upperBound> | ||
</Uniform> | ||
</Distributions> | ||
|
||
<Samplers> | ||
<Grid name="coarse"> | ||
<variable name="x1"> | ||
<distribution>u1</distribution> | ||
<grid construction="equal" steps="1" type="CDF">0.0 1.0</grid> | ||
</variable> | ||
<constant name="x2">2.0</constant> | ||
</Grid> | ||
<Grid name="fineRestart"> | ||
<variable name="x1"> | ||
<distribution>u1</distribution> | ||
<grid construction="equal" steps="2" type="CDF">0.0 1.0</grid> | ||
</variable> | ||
<variable name="x2"> | ||
<distribution>u2</distribution> | ||
<grid construction="equal" steps="2" type="CDF">0.0 1.0</grid> | ||
</variable> | ||
<Restart class="DataObjects" type="PointSet">solns</Restart> | ||
</Grid> | ||
</Samplers> | ||
|
||
<Models> | ||
<Dummy name="MyDummy" subType=""/> | ||
<!-- The "coarsemod" model will output a reponse of 1.0, while "finemod" gives 2.0. | ||
This allows the test to distinguish which samples originated in "coarse" and which in "fine".--> | ||
<ExternalModel ModuleToLoad="../coarse" name="coarsemod" subType=""> | ||
<variables>x1,x2,ans</variables> | ||
</ExternalModel> | ||
<ExternalModel ModuleToLoad="../fine" name="finemod" subType=""> | ||
<variables>x1,x2,ans</variables> | ||
</ExternalModel> | ||
</Models> | ||
|
||
<DataObjects> | ||
<PointSet name="dummyIN"> | ||
<Input>x1,x2</Input> | ||
<Output>OutputPlaceHolder</Output> | ||
</PointSet> | ||
<PointSet name="solns"> | ||
<Input>x1,x2</Input> | ||
<Output>ans</Output> | ||
</PointSet> | ||
<PointSet name="solnsRestart"> | ||
<Input>x1,x2</Input> | ||
<Output>ans</Output> | ||
</PointSet> | ||
</DataObjects> | ||
|
||
<OutStreams> | ||
<Print name="coarse"> | ||
<type>csv</type> | ||
<source>solns</source> | ||
<what>input,output</what> | ||
</Print> | ||
<Print name="restart"> | ||
<type>csv</type> | ||
<source>solnsRestart</source> | ||
<what>input,output</what> | ||
</Print> | ||
</OutStreams> | ||
|
||
</Simulation> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters