Giter Club home page Giter Club logo

Comments (5)

jmejia8 avatar jmejia8 commented on July 1, 2024 1

I already implemented that feature but is still at develop branch
It will be merged to main branch ASAP.

from metaheuristics.jl.

jmejia8 avatar jmejia8 commented on July 1, 2024 1

You can do it as follows:

f, bounds, optimums = Metaheuristics.TestProblems.get_problem(:sphere)
D = size(bounds,2)

# known solution
x_known = 0.6ones(D)

# random solutions (uniform distribution)
X = [ bounds[1,:] + rand(D).* ( bounds[2,:] -  bounds[1,:]) for i in 1:19  ]

push!(X, x_known) # save an interest solution

# generate the population with 19+1 solutions
population = [ Metaheuristics.create_child(x, f(x)) for x in X ]

# prior state
prev_status = State(Metaheuristics.get_best(population), population)

# say to ECA that you have generated a population
method = ECA(N = length(population))
method.status = prev_status

# optimize
optimize(f, bounds, method)

If you also know x_known and fx = f(x_known), then instead of pushing x into X,
you may do push!(population, Metaheuristics.create_child(x_known, fx)).

from metaheuristics.jl.

jmejia8 avatar jmejia8 commented on July 1, 2024

By default the population size in ECA is N = K * D where K = 7 and D is the dimension number (parameters), maybe you should change the value N (say N=100). Also limit the number of function evaluations.

Example:

options = Options(f_calls_limit=10_000)
method = ECA(N = 100, options = options)
optimize(f, bounds, method)

Note that ECA and the other metaheuristics implemented in this Package work well for up to 100 parameters. Probably later some methods for large-scale problems (>100 parameters) will be implemented.

from metaheuristics.jl.

scepeda78 avatar scepeda78 commented on July 1, 2024

Thanks now it worked!, I limited the population size. Do you now if an initial population can be given as hot start solution?.

from metaheuristics.jl.

scepeda78 avatar scepeda78 commented on July 1, 2024

I already implemented that feature but is still at develop branch
It will be merged to main branch ASAP.

How would you declare an starting point from the beginning?, since the example provided assume that you have a previous population and a result from a previous optimization process..

from metaheuristics.jl.

Related Issues (20)

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.