Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何解决离散化处理 #10

Open
moryKylin opened this issue Nov 30, 2017 · 6 comments
Open

如何解决离散化处理 #10

moryKylin opened this issue Nov 30, 2017 · 6 comments

Comments

@moryKylin
Copy link

(先膜拜一下大佬)我看框架里面会根据取值范围和精确度确定基因长度,如果是离散的变量的话就不能这么做了,刚开始看还没看完框架,不知道是否可以有另一种方式,通过直接给出基因序列和长度来进行优化

@PytLab
Copy link
Owner

PytLab commented Nov 30, 2017

你好,感谢对gaft的支持,其实是可以通过设置适当的精度和范围来进行离散化的变量的,例如取值范围[0.0, 3.0], 精度1.0这样,不过目前gaft对于整除的基因转换存在一个小bug,类似issue#4中提到的,我最近会找个时间把此问题修复,也欢迎pull request。😝

@moryKylin
Copy link
Author

我说的离散变量其实不是这样的,虽然说以精度1.0以后来说,有0,1,2,3这些变量,但他其实还是属于连续的,离散的意思是比如[1,2,0,7,9]这样的序列,但是刚想明白了,可以用离散序列的index进行编码,然后再在适应度函数那里处理应该可以解决

@PytLab
Copy link
Owner

PytLab commented Dec 4, 2017

嗯,你可以使用上面的方法。同时最近我在考虑给gaft的individual定义写个元类,这样就可以用户自定义了,写好了会进行更新。

@Asber777
Copy link

大佬你好 我发现2D优化的时候 BinaryIndividual(ranges=[(0.0, 50.0), (0.0, 100.0)], eps=1.0)
结果还是会有小数 这个怎么办呢?

@moryKylin
Copy link
Author

emmm,你可以去问大佬,,,我个人认为,你的参数里面都是小数,结果当然也会是小数,可能需要修改大佬的框架 @huoganji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@PytLab @moryKylin @Asber777 and others