-
Notifications
You must be signed in to change notification settings - Fork 19
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
Representation
doesn't allow the passing of parameters to individual_cls
#278
Comments
Is there a particular scenario/usage where this has posed a problem recently? |
Since pytorch is primarily used for deep learning, I gave a hand at memetic algorithms with my extra library using deep learning as the local search. In memetic algorithms there are Baldwinian and Lamarckian variants, where in Lamarckian the genome is replaced with the one found after local search while the Baldwinian is not. Since the two both have benefits, and I was using a real valued genome, I parameterized this with an alpha value that controlled how much of the change due to the local search was applied back to the base genome. In any case, since the genome has to be updated after every fitness evaluation, I subclassed |
Looking through the code, I'm reconsidering my approach. While I think the ability to pass parameters through a |
That sounds like a really cool project! I've done quite a bit of lit review & hacking around Baldwinian vs. Lamarckian methods, but never thought of having a parameter that tunes a balance between the two! You're right that it seems that Is there a way we could make |
Oddly enough, when I discussed this with Luke earlier I observed that initializers are a kind of factory function, and that we could explore maybe parameterizing that in some way. |
I think that the intent of the I think this ties in well with #155, where changing how we construct the initial population would come in handy. I think rather than passing around |
Actually, I think it would reduce boilerplate since we could then drop |
@lukepmccombs: I think this is a good proposal. (Thinking through the cons.) Having the initializer be part of the Especially now that we've changed |
I've found another problem point with subclassing |
Just a quick note, @SigmaX and I are going to continue this discussion when the three of us can be in a meeting. |
If using a subclass of
Individual
that has parameters, they cannot be overridden when created using aRepresentation
.The text was updated successfully, but these errors were encountered: