Skip to content
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

[DEFECT] Unable to set convergence criterial for Genetic Algorithm #2233

Open
3 of 13 tasks
cbroman-usnctech opened this issue Dec 19, 2023 · 2 comments
Open
3 of 13 tasks

Comments

@cbroman-usnctech
Copy link

cbroman-usnctech commented Dec 19, 2023

Thank you for the defect report

Defect Description

Setting the node results with any option other than results in the error:

(    0.01 sec) GeneticAlgorithm         : ERROR           -> Some requested SolutionExport variables are not generated as part of this entity: {'conv_objective'}
-> Valid unused options include: {'AHDp', 'AHD', 'HDSM', 'conv_AHDp', 'rejectReason'}

Steps to Reproduce

A template for setting up the failed run is provided below (some functions are omitted for privacy)

<?xml version="1.0" ?>
<Simulation verbosity="debug">
  <TestInfo>
    <author>user</author>
    <created>2023-12-18</created>
    <description>
       A template for running the genetic algorithm.
    </description>
  </TestInfo>
  <RunInfo>
    <JobName>analytic-optimization-coefficients</JobName>
    <Sequence>analytic-optimization-coefficients,print</Sequence>
    <WorkingDir>.</WorkingDir>
    <batchSize>10</batchSize>
  </RunInfo>

  <Steps>
    <MultiRun name="analytic-optimization-coefficients" clearRunDir="False">
      <Model class="Models" type="Code">my_raptor</Model>
      <Optimizer class="Optimizers" type="GeneticAlgorithm">genAlgo</Optimizer>
      <SolutionExport class="DataObjects" type="PointSet">opt_export</SolutionExport>
      <Output class="DataObjects" type="PointSet">optResults</Output>
      <Output class="DataObjects" type="PointSet">results</Output>
      <Output class="OutStreams" type="Print">opt_export</Output>
    </MultiRun>
    <IOStep name="print">
      <Input class="DataObjects" type="PointSet">opt_export</Input>
      <Input class="DataObjects" type="PointSet">results</Input>
      <Output class="OutStreams" type="Print">opt_export</Output>
      <Output class="OutStreams" type="Print">results</Output>
    </IOStep>
  </Steps>
  <Models>

  </Models>
  <Optimizers>
    <GeneticAlgorithm name="genAlgo">
      <samplerInit>
        <limit>10</limit>
        <initialSeed>123456</initialSeed>
        <type>min</type>
        <writeSteps>every</writeSteps>
      </samplerInit>
      <GAparams>
        <populationSize>20</populationSize>
        <parentSelection>rouletteWheel</parentSelection>
        <reproduction>
          <crossover type="onePointCrossover">
            <crossoverProb>0.8</crossoverProb>
          </crossover>
          <mutation type="swapMutator">
            <mutationProb>0.8</mutationProb>
          </mutation>
        </reproduction>
        <fitness type="invLinear">
          <a>1.0</a>
          <b>0.0</b>
        </fitness>
        <survivorSelection>fitnessBased</survivorSelection>
      </GAparams>
      <convergence>
        <AHDp>0.1</AHDp>
      </convergence>
      <objective>obj</objective>
      <TargetEvaluation class="DataObjects" type="PointSet">optResults</TargetEvaluation>
      <Sampler class="Samplers" type="MonteCarlo">MC_samp</Sampler>
      <variable name="Xwidth">
        <distribution>XwidthDist</distribution>
      </variable>
      <variable name="Ywidth">
        <distribution>YwidthDist</distribution>
      </variable>
    </GeneticAlgorithm>
  </Optimizers>
  <Samplers>
    <MonteCarlo name="MC_samp">
      <samplerInit>
        <limit>20</limit>
        <initialSeed>123456</initialSeed>
      </samplerInit>
      <variable name="Xwidth">
        <distribution>XwidthDist</distribution>
      </variable>
      <variable name="Ywidth">
        <distribution>YwidthDist</distribution>
      </variable>
    </MonteCarlo>
  </Samplers>
  <Functions>
  </Functions>
  <Distributions>
    <Uniform name="XwidthDist">
      <lowerBound>0.0</lowerBound>
      <upperBound>1.0</upperBound>
    </Uniform>
    <Uniform name="YwidthDist">
      <lowerBound>1.0</lowerBound>
      <upperBound>4.5</upperBound>
    </Uniform>
  </Distributions>
  <VariableGroups>
    <Group name="invars">Xwidth,Ywidth</Group>
    <Group name="outvars">targetVal,time,hdfFile,obj</Group>
    <Group name="all">Xwidth,Ywidth,obj,targetVal,time</Group>
  </VariableGroups>
  <DataObjects>
    <PointSet name="results">
      <Input>Xwidth,Ywidth</Input>
      <Output>hdfFile,obj,targetVal,time</Output>
    </PointSet>
    <PointSet name="optResults">
      <Input>Xwidth,Ywidth</Input>
      <Output>obj,targetVal,time</Output>
    </PointSet>
    <PointSet name="opt_export">
      <Input>trajID</Input>
      <Output>all,age,batchId,fitness,iteration,accepted,conv_objective</Output>
    </PointSet>
  </DataObjects>
  <OutStreams>
    <Print name="results" dir="analytic-optimization-coefficients">
      <type>csv</type>
      <source>results</source>
      <what>input,output</what>
    </Print>
    <Print name="opt_export" dir="analytic-optimization-coefficients">
      <type>csv</type>
      <source>opt_export</source>
      <clusterLabel>trajID</clusterLabel>
      <what>input,output</what>
    </Print>
  </OutStreams>
</Simulation> 

note the line:

<convergence>
      <AHDp>0.1</AHDp>
</convergence>

If AHDp is changed to any other option for that matter Raven still will not run.

Expected Behavior

Setting the convergence criterial as per the user docs would allow for the successful exit of Raven when search convergence criteria is met.

Screenshots and Input Files

No response

OS

Linux

OS Version

No response

Dependency Manager

PIP

For Change Control Board: Issue Review

  • Is it tagged with a type: defect or task?
  • Is it tagged with a priority: critical, normal or minor?
  • If it will impact requirements or requirements tests, is it tagged with requirements?
  • If it is a defect, can it cause wrong results for users? If so an email needs to be sent to the users.
  • Is a rationale provided? (Such as explaining why the improvement is needed or why current code is wrong.)

For Change Control Board: Issue Closure

  • If the issue is a defect, is the defect fixed?
  • If the issue is a defect, is the defect tested for in the regression test system? (If not explain why not.)
  • If the issue can impact users, has an email to the users group been written (the email should specify if the defect impacts stable or master)?
  • If the issue is a defect, does it impact the latest release branch? If yes, is there any issue tagged with release (create if needed)?
  • If the issue is being closed without a pull request, has an explanation of why it is being closed been provided?
@wangcj05
Copy link
Collaborator

@JunyungKim Could you take a look at this issue?

@alfoa
Copy link
Collaborator

alfoa commented May 8, 2024

@JunyungKim are you looking at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants