Skip to content

Example Workflow: Optimization

Luis Rodriguez edited this page Jul 2, 2019 · 2 revisions

This example demonstrates SABER's optimization capabilities using the xbrain pipeline. It has been simplified to run on a 2D image to increase runtime on local machines.

Building tool containers

If you have ran the xbrain example, this step isn't necessary.

  1. Build the xbrain container

    cd saber/saber/xbrain/
    docker build -t aplbrain/xbrain .

Setting parameters

Parameters for this workflow can be found in saber/xbrain/example2d/params.yml

Compiling and launching the workflow

This step is like the other workflows, but it doesn't require you to run the workflow through the web interface.

  1. Open a bash shell in the cwl_parser container

    docker exec -it conduit_docker_cwl_parser_1 /bin/bash
    
  2. Navigate to the xbrain example2d folder and run the conduit build command.

    cd saber/xbrain/example2d/
    conduit build optimization2d.cwl job.yml
    
  3. Now start the optimization with conduit optimize

    conduit optimize workflow.cwl example-job.yml params.yml --max-iterations=100
    

    This will run a workflow, collect the F1 scores of the xbrain pipeline on the image, and then resample the parameters set the in the params.yml file and run another workflow. Finally, it will save the results of all the runs, along with their parameters, to optiout.csv

    The optimization method used by default is random, but can be expanded by the user.