Coder Social home page Coder Social logo

Comments (4)

keurfonluu avatar keurfonluu commented on June 12, 2024

Hi @ariellellouch,

That was actually planned, I just didn't have time to implement such feature. But basically, right now, it's possible to do it by:

  • manually initializing the population with only increasing velocity models (yet still random)
  • adding a penalty term for models that do not satisfy that constraint (via argument extra_terms in configure)

But it will definitely be better to have a boolean option to automate that.

from evodcinv.

ariellellouch avatar ariellellouch commented on June 12, 2024

Thanks!
I am a bit scared to play with the extra_terms without an example, but will give it a go! :)

Edit:
Quick and dirty solution which assures Vs is going up with depth (I'm sure this can be made prettier and not depend on the structure of x, but I am not a good enough coder). Adding extra_terms=inc_misfit works for me.

def inc_misfit(x):
nel = int((np.size(x)-2)/3)
return 999999.9 * np.any(np.diff(x[nel:2*nel+1])<0)

from evodcinv.

keurfonluu avatar keurfonluu commented on June 12, 2024

As long as it works!

I added an option increasing_velocity in configure that initializes the population with increasing velocity models, and adds a penalty term to reject generated models given the constraint:

model.configure(
    optimizer="cpso",  # Evolutionary algorithm
    misfit="rmse",  # Misfit function type
    optimizer_args={
        "popsize": 10,  # Population size
        "maxiter": 100,  # Number of iterations
        "workers": -1,  # Number of cores
        "seed": 0,
    },
    increasing_velocity=True,
)

You can update to evodcinv v2.1.1: pip install evodcinv -U.

from evodcinv.

ariellellouch avatar ariellellouch commented on June 12, 2024

Fantastic, thanks again and sorry for bugging you :)

from evodcinv.

Related Issues (11)

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.