Code Monkey home page Code Monkey logo

Comments (2)

makabaka123456 avatar makabaka123456 commented on May 20, 2024 2

非常感谢。元宵节快乐~~

from gaft.

PytLab avatar PytLab commented on May 20, 2024

无论是多少参数,gaft的使用方式都是相同的,这边我写了两个例子分别是优化有一个参数和两个参数的目标函数,更多参数可以通过在定义Individual的时候的给ranges再添加一个元素就好了,例如:

indv_template = BinaryIndividual(ranges=[(-2, 2), (-10, 2), (-10, 10)], eps=0.001)
population = Population(indv_template=indv_template, size=50).init()

这样你就创建了含有三个变量的大小为50的种群

剩下的就可以通过定义你自己的适应度函数就好了,注意适应度函数需要返回一个float类型的返回值,方便gaft对适应度函数的值进行操作。

from gaft.

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.