jameshughes89 / cs4XX-EvolutionaryComputation

CS 4XX: Evolutionary Computation
http://csci340.com/
GNU General Public License v3.0
6 stars 27 forks source link

:mortar_board: :bug: Symbolic regression --- Use genetic operator constants :microscope: #149

Closed jameshughes89 closed 1 year ago

jameshughes89 commented 1 year ago

Related Issues or PRs

143

kinda #147

What

Actually use the constants in the code for the genetic operator rates

Why

I forgot

Testing

:+1:

jameshughes89 commented 1 year ago

I love how a handful of context-free constants at the top of a file are considered hyperparameters. You can really tell that those involved have no experience in software.

How would you typically go about doing it? Something like a settings dictionary?

twentylemon commented 1 year ago

A global dictionary is exactly what you already have, a set of strings which correspond to a value. The same problems still exist even if you nest in the global dictionary (like { "part1": { "param": 2 } }, as you modify part1's behaviour with no context.

I'd probably argue for functions and magic numbers. Functions provide context, and there's no real value in writing param=PARAM instead of param=2 (unless PARAM is cross-cutting, which does not seem to be the case here). Local constants may be helpful if the relevant parameters are not part of kwargs.