<commit_before><?xml version="1.0" ?>
<Simulation verbosity="debug">
  <!-- Test info -->
  <TestInfo>
    <name>framework/Optimizers/Beale</name>
    <author>talbpaul</author>
    <created>2017-05-03</created>
    <classesTested>Optimizer</classesTested>
    <description>
      This test runs the optimization on Beale's function.  It tests analytic optimization values
      as well as the mechanical operation of the test.
    </description>
    <analytic>
      This test uses Beale's function, which is documented in the analytic tests documentation under
      the Optimizer functions section.
    </analytic>
  </TestInfo>

  <!-- actual RAVEN input -->
  <RunInfo>
    <WorkingDir>Beale</WorkingDir>
    <Sequence>optimize,print,getOptPoint</Sequence>
    <batchSize>1</batchSize>
  </RunInfo>

  <Steps>
    <MultiRun name="optimize">
      <Input class="DataObjects" type="PointSet">dummyIN</Input>
      <Model class="Models" type="ExternalModel">beale</Model>
      <Optimizer class="Optimizers" type="SPSA">opter</Optimizer>
      <SolutionExport class="DataObjects" type="HistorySet">opt_export</SolutionExport>
      <Output class="DataObjects" type="PointSet">optOut</Output>
    </MultiRun>
    <IOStep name="print" pauseAtEnd="True">
      <Input class="DataObjects" type="PointSet">optOut</Input>
      <Input class="DataObjects" type="HistorySet">opt_export</Input>
      <Output class="OutStreams" type="Print">opt_dump</Output>
      <Output class="OutStreams" type="Print">opt_export</Output>
      <Output class="OutStreams" type="Plot">trajectory</Output>
      <Output class="OutStreams" type="Plot">convergenceHistory</Output>
    </IOStep>
    <PostProcess name="getOptPoint">
      <Input class="DataObjects" type="HistorySet">opt_export</Input>
      <Model class="Models" type="PostProcessor">snapshot</Model>
      <Output class="DataObjects" type="PointSet">opt_soln</Output>
      <Output class="OutStreams" type="Print">opt_soln</Output>
    </PostProcess>
  </Steps>

  <Optimizers>
    <SPSA name="opter">
      <initialization>
        <limit>2000</limit>
        <initialSeed>42</initialSeed>
        <thresholdTrajRemoval>1e-5</thresholdTrajRemoval>
      </initialization>
      <TargetEvaluation class="DataObjects" type="PointSet">optOut</TargetEvaluation>
      <convergence>
          <relativeThreshold>1e-6</relativeThreshold>
          <gradientThreshold>1e-2</gradientThreshold>
      </convergence>
      <variable name='x'>
        <upperBound>4.5</upperBound>
        <lowerBound>-4.5</lowerBound>
        <!--initial>0,-2,-2,2,2</initial-->
      </variable>
      <variable name='y'>
        <upperBound>4.5</upperBound>
        <lowerBound>-4.5</lowerBound>
        <!--initial>0,-3,3,-3,3</initial-->
      </variable>
      <objectVar>ans</objectVar>
      <!--multilevel>
        <subspace name='first'>x</subspace>
        <subspace name='second'>y</subspace>
        <sequence>first,second</sequence>
      </multilevel-->
    </SPSA>
  </Optimizers>

  <Models>
    <Dummy name="MyDummy" subType=""/>
    <ExternalModel ModuleToLoad="../../../framework/AnalyticModels/optimizing/beale" name="beale" subType="">
      <variables>x,y,ans</variables>
    </ExternalModel>
    <PostProcessor name="snapshot" subType="InterfacedPostProcessor">
      <method>HistorySetSnapShot</method>
      <type>max</type>
      <pivotVar>varsUpdate</pivotVar>
    </PostProcessor>
  </Models>

  <DataObjects>
    <PointSet name="dummyIN">
      <Input>x,y</Input>
      <Output>OutputPlaceHolder</Output>
    </PointSet>
    <PointSet name="optOut">
      <Input>x,y</Input>
      <Output>ans</Output>
    </PointSet>
    <HistorySet name="opt_export">
      <Input>trajID</Input>
      <Output>x,y,ans,varsUpdate</Output>
    </HistorySet>
    <PointSet name="opt_soln">
      <Input>trajID</Input>
      <Output>x,y,ans,varsUpdate</Output>
    </PointSet>
  </DataObjects>

  <OutStreams>
    <Print name="opt_dump">
      <type>csv</type>
      <source>optOut</source>
    </Print>
    <Print name="opt_export">
      <type>csv</type>
      <source>opt_export</source>
    </Print>
    <Print name="opt_soln">
      <type>csv</type>
      <source>opt_soln</source>
    </Print>
    <Plot  name="trajectory" overwrite="false" verbosity="debug">
        <plotSettings>
            <plot>
                <type>scatter</type>
                <x>optOut|Input|x</x>
                <y>optOut|Input|y</y>
                <z>optOut|Output|ans</z>
            </plot>
            <xlabel>x</xlabel>
            <ylabel>y</ylabel>
            <zlabel>ans</zlabel>
        </plotSettings>
        <actions>
            <how>png</how>
            <title>
                <text> </text>
            </title>
        </actions>
    </Plot>
    <Plot  name="convergenceHistory" overwrite="false" verbosity="debug">
        <plotSettings>
            <plot>
                <type>scatter</type>
                <x>opt_export|Output|varsUpdate</x>
                <y>opt_export|Output|ans</y>
            </plot>
            <xlabel>iteration</xlabel>
            <ylabel>ans</ylabel>
        </plotSettings>
        <actions>
            <how>png</how>
            <title>
                <text> </text>
            </title>
        </actions>
    </Plot>
  </OutStreams>

</Simulation>
<commit_msg>cleaned up comments for scripts sake<commit_after><?xml version="1.0" ?>
<Simulation verbosity="debug">
  <TestInfo>
    <name>framework/Optimizers/Beale</name>
    <author>talbpaul</author>
    <created>2017-05-03</created>
    <classesTested>Optimizer</classesTested>
    <description>
      This test runs the optimization on Beale's function.  It tests analytic optimization values
      as well as the mechanical operation of the test.
    </description>
    <analytic>
      This test uses Beale's function, which is documented in the analytic tests documentation under
      the Optimizer functions section.
    </analytic>
  </TestInfo>

  <RunInfo>
    <WorkingDir>Beale</WorkingDir>
    <Sequence>optimize,print,getOptPoint</Sequence>
    <batchSize>1</batchSize>
  </RunInfo>

  <Steps>
    <MultiRun name="optimize">
      <Input class="DataObjects" type="PointSet">dummyIN</Input>
      <Model class="Models" type="ExternalModel">beale</Model>
      <Optimizer class="Optimizers" type="SPSA">opter</Optimizer>
      <SolutionExport class="DataObjects" type="HistorySet">opt_export</SolutionExport>
      <Output class="DataObjects" type="PointSet">optOut</Output>
    </MultiRun>
    <IOStep name="print" pauseAtEnd="True">
      <Input class="DataObjects" type="PointSet">optOut</Input>
      <Input class="DataObjects" type="HistorySet">opt_export</Input>
      <Output class="OutStreams" type="Print">opt_dump</Output>
      <Output class="OutStreams" type="Print">opt_export</Output>
      <Output class="OutStreams" type="Plot">trajectory</Output>
      <Output class="OutStreams" type="Plot">convergenceHistory</Output>
    </IOStep>
    <PostProcess name="getOptPoint">
      <Input class="DataObjects" type="HistorySet">opt_export</Input>
      <Model class="Models" type="PostProcessor">snapshot</Model>
      <Output class="DataObjects" type="PointSet">opt_soln</Output>
      <Output class="OutStreams" type="Print">opt_soln</Output>
    </PostProcess>
  </Steps>

  <Optimizers>
    <SPSA name="opter">
      <initialization>
        <limit>2000</limit>
        <initialSeed>42</initialSeed>
        <thresholdTrajRemoval>1e-5</thresholdTrajRemoval>
      </initialization>
      <TargetEvaluation class="DataObjects" type="PointSet">optOut</TargetEvaluation>
      <convergence>
          <relativeThreshold>1e-6</relativeThreshold>
          <gradientThreshold>1e-2</gradientThreshold>
      </convergence>
      <variable name='x'>
        <upperBound>4.5</upperBound>
        <lowerBound>-4.5</lowerBound>
      </variable>
      <variable name='y'>
        <upperBound>4.5</upperBound>
        <lowerBound>-4.5</lowerBound>
      </variable>
      <objectVar>ans</objectVar>
    </SPSA>
  </Optimizers>

  <Models>
    <Dummy name="MyDummy" subType=""/>
    <ExternalModel ModuleToLoad="../../../framework/AnalyticModels/optimizing/beale" name="beale" subType="">
      <variables>x,y,ans</variables>
    </ExternalModel>
    <PostProcessor name="snapshot" subType="InterfacedPostProcessor">
      <method>HistorySetSnapShot</method>
      <type>max</type>
      <pivotVar>varsUpdate</pivotVar>
    </PostProcessor>
  </Models>

  <DataObjects>
    <PointSet name="dummyIN">
      <Input>x,y</Input>
      <Output>OutputPlaceHolder</Output>
    </PointSet>
    <PointSet name="optOut">
      <Input>x,y</Input>
      <Output>ans</Output>
    </PointSet>
    <HistorySet name="opt_export">
      <Input>trajID</Input>
      <Output>x,y,ans,varsUpdate</Output>
    </HistorySet>
    <PointSet name="opt_soln">
      <Input>trajID</Input>
      <Output>x,y,ans,varsUpdate</Output>
    </PointSet>
  </DataObjects>

  <OutStreams>
    <Print name="opt_dump">
      <type>csv</type>
      <source>optOut</source>
    </Print>
    <Print name="opt_export">
      <type>csv</type>
      <source>opt_export</source>
    </Print>
    <Print name="opt_soln">
      <type>csv</type>
      <source>opt_soln</source>
    </Print>
    <Plot  name="trajectory" overwrite="false" verbosity="debug">
        <plotSettings>
            <plot>
                <type>scatter</type>
                <x>optOut|Input|x</x>
                <y>optOut|Input|y</y>
                <z>optOut|Output|ans</z>
            </plot>
            <xlabel>x</xlabel>
            <ylabel>y</ylabel>
            <zlabel>ans</zlabel>
        </plotSettings>
        <actions>
            <how>png</how>
            <title>
                <text> </text>
            </title>
        </actions>
    </Plot>
    <Plot  name="convergenceHistory" overwrite="false" verbosity="debug">
        <plotSettings>
            <plot>
                <type>scatter</type>
                <x>opt_export|Output|varsUpdate</x>
                <y>opt_export|Output|ans</y>
            </plot>
            <xlabel>iteration</xlabel>
            <ylabel>ans</ylabel>
        </plotSettings>
        <actions>
            <how>png</how>
            <title>
                <text> </text>
            </title>
        </actions>
    </Plot>
  </OutStreams>

</Simulation>

{'fraction_non_alphanumeric': 0.15540345126771427, 'fraction_numerical': 0.006941097078954979, 'mean_word_length': 2.7370317002881843, 'pattern_counts': {'":': 0, '<': 437, '<?xml version=': 2, '>': 437, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6702859', 'n_tokens_mistral': 3373, 'n_tokens_neox': 3270, 'n_words': 511}