Giter Site home page Giter Site logo

nomad.jl's Introduction

NOMAD.jl

Documentation Build Status Coverage DOI
Coverage Status DOI

This package provides a Julia interface for NOMAD, which is a C++ implementation of the Mesh Adaptive Direct Search algorithm (MADS), designed for difficult blackbox optimization problems. These problems occur when the functions defining the objective and constraints are the result of costly computer simulations.

How to Cite

If you use NOMAD.jl in your work, please cite using the format given in CITATION.bib.

Installation

NOMAD can be installed and tested through the Julia package manager:

julia> ]
pkg> add NOMAD
pkg> test NOMAD

Quick start

Let's say you want to minimize some objective function :

function f(x)
  return x[1]^2 + x[2]^2
end

while keeping some constraint inferior to 0 :

function c(x)
  return 1 - x[1]
end

You first need to declare a function eval_fct(x::Vector{Float64}) that returns a Vector{Float64} containing the objective function and the constraint evaluated for x, along with two booleans.

function eval_fct(x)
  bb_outputs = [f(x), c(x)]
  success = true
  count_eval = true
  return (success, count_eval, bb_outputs)
end

success is a boolean set to false if the evaluation should not be taken into account by NOMAD. Here, every evaluation will be considered as a success. count_eval is also a boolean, it decides weather the evaluation's counter will be incremented. Here, it is always equal to true so every evaluation will be counted.

Then, create an object of type NomadProblem that will contain settings for the optimization.

The classic constructor takes as arguments the initial point x0 and the types of the outputs contained in bb_outputs (as a Vector{String}).

pb = NomadProblem(2, # number of inputs of the blackbox
                  2, # number of outputs of the blackbox
                  ["OBJ", "EB"], # type of outputs of the blackbox
                  eval_fct;
                  lower_bound=[-5.0, -5.0],
                  upper_bound=[5.0, 5.0])

Here, first element of bb_outputs is the objective function (f(x)), second is a constraint treated with the Extreme Barrier method (c(x)). In this example, lower and upper bounds have been added but it is not compulsory.

Now call the function solve(p::NomadProblem, x0::Vector{Float64}) where x0 is the initial starting point to launch a NOMAD optimization process.

result = solve(pb, [3.0, 3.0])

The object returned by solve() contains information about the run.

nomad.jl's People

Contributors

amontoison avatar ppascal97 avatar salomonl avatar sobhanmp 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.