Giter Site home page Giter Site logo

optimizer's Introduction

An Introduction to Ocelot Optimizer

Ocelot optimizer is a platform for automated optimization of accelerator performance.

It is an open source project and it is being developed by physicists from The European XFEL, DESY, SLAC.

Use cases

The Optimizer is used for many different types of optimization.

  • FEL facilities:

    • FEL pulse energy maximization with:
      • Phase-shifters (EuXFEL)
      • Orbit in low energy sections (EuXFEL)
      • Matching quads (LCLS & EuXFEL)
      • RF settings (EuXFEL)
      • Launch orbit and orbit inside an undulator (EuXFEL)
    • Local dispersion correction (EuXFEL & FLASH)
    • HOM signal minimization in cavities (FLASH)
  • Storage rings (tests):

    • Injection efficiency optimization (Kurchatov Institute)
    • Beam life time (test at BESSY-II)

Ocelot schematic

From the beginning, Ocelot Optimizer was used by a few facilities (EuXFEL, LCLS, FLASH). To keep compatibility of the tool between them, an abstraction layer called Machine Interface was developed. The Machine Interface communicates with an accelerator control system and contains all machine related specifics. Algorithm API is designed to be a layer of abstraction between the Optimizer and an optimization methods.

Ocelot Optimizer includes:

Graphical User Interface

Ocelot Optimizer was designed to cover as many as possible optimization problems especially during an accelerator commissioning. We tried to build GUI which reflects that goal. With GUI you can:

  • Select different optimizers (Simplex, GP, ES, …)
  • Select any group of devices
  • Craft your objective function 
    • Simple PV
    • Do math on up to 5 PVs
    • Statistics: mean, stdev, quantiles
    • Write python script (loaded/edited via GUI)
    • Option to have simulated objective to test optimization methods
  • Data browser - choose any point from the history of the last optimization
  • Save predefined settings & routines

How to get started

python generic_optim.py MultinormalInterface

  • to ask help:

python generic_optim.py --help

  • Edit template machine interface to map in your control system:

python generic_optim.py MultinormalInterface

class DemoInterface(MachineInterface):
    name = 'DemoInterface'

    def __init__(self, args=None):
        super(DemoInterface, self).__init__(args=args)

        # self.config_dir is path to a directory where a default config will be saved (the tool state)
        # self.config_dir = "<optimizer>/parameters/" is default path in the parent class MachineInterface
        self.config_dir = os.path.join(self.config_dir, "demo")  # <optimizer>/parameters/demo

        # self.path2jsondir is a path to a folder where optimization histories will be saved in json format
        # by default self.path2jsondir = <data> on the same level that <optimizer>
        # the folder will be created automatically

        # flag from LCLSInterface which not allow Optimizer to write to control system
        self.read_only = False

    def get_value(self, channel):
        print("Called get_value for channel: {}.".format(channel))
        return random.random()

    def set_value(self, channel, val):
        print("Called set_value for channel: {}, with value: {}".format(channel, val))

As a second step we recommend to have a look to XFELMachineInterface and also TestMachineInterface which you can run using:

python generic_optim.py --devmode

See the parent class MachineInterface to have more configurable options.

optimizer's People

Contributors

sergey-tomin avatar hhslepicka avatar lisazacarias avatar adkoo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.