-
Notifications
You must be signed in to change notification settings - Fork 88
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
Refactor API: ComposerRequirements and ComposerBuilder #852
Conversation
Codecov Report
@@ Coverage Diff @@
## master #852 +/- ##
==========================================
+ Coverage 87.72% 87.97% +0.24%
==========================================
Files 195 196 +1
Lines 13356 13345 -11
==========================================
+ Hits 11717 11740 +23
+ Misses 1639 1605 -34
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
11be5d6
to
a20e97d
Compare
Hello @gkirgizov! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-09-13 08:15:25 UTC |
@@ -15,35 +18,43 @@ class MutationStrengthEnum(Enum): | |||
|
|||
@dataclass | |||
class PipelineComposerRequirements(ComposerRequirements): | |||
""" | |||
Dataclass is for defining the requirements for composition process of genetic programming composer | |||
"""Defines algorithm-specific parameters of evolutionary optimizer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
algorithm-specific parameters
Не очень понятно, про какой алгоритм речь.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
подредактировал f0f8467
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Parameters of evolutionary optimizer that define features of the evolutionary algorithm
and restrictions on the graph composition process"
Я думаю тут стоит сформулировать отличия PipelineComposerRequirements от OptimiserRequirements, чтобы не было путаницы. Даже если сейчас не будет полностью разделять - стоит пояснить, почему это вообще два разных класса.
:param crossover_prob: crossover probability (the chance that two chromosomes exchange some of their parts) | ||
:param mutation_prob: mutation probability | ||
:param mutation_strength: strength of mutation in tree (using in certain mutation types) | ||
:param max_pipeline_fit_time: time constraint for operation fitting (minutes) | ||
:param start_depth: start value of tree depth | ||
:param validation_blocks: number of validation blocks for time series validation | ||
:param n_jobs: num of n_jobs | ||
:param show_progress: bool indicating whether to show progress using tqdm or not | ||
:param collect_intermediate_metric: save metrics for intermediate (non-root) nodes in pipeline | ||
:param keep_n_best: Number of the best individuals of previous generation to keep in next generation. | ||
|
||
Population and graph parameters, possibly adaptive: | ||
:param offspring_rate: offspring rate used on next population | ||
:param pop_size: initial population size; if unspecified, default value is used | ||
:param max_pop_size: maximum population size; optional, if unspecified, then population size is unbound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А должны ли ту быть специфичные именно для эволюции штуки? Предполагал что в req к композеру будет как раз-то, что от оптимизатора не зависит (max_depth, например)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты про crossover_prob, mutation_prob, mutation_strength
? Согласен, тоже хотел их перенести в GraphOptimizerParameters
, но наткнулся на то, что придется побольше кода менять -- тк в процессе эволюции именно requirements адаптивно модифицируются. Это чисто техническая проблемка -- подумаю еще, как это получше организовать. В этом PR не хотелось много времени на это тратить. Тут более простая реорганизация, которая особых изменений в коде оптимизатора не потребовала. Предлагаю это в другом PR устроить, тут уже хватает изменений.
И в целом различие между композером и оптимизтором особо не определено. Все параметры так или иначе параметры оптимизатора. Тут скорее различие в том, что какие-то относятся именно к эволюционному алогритму, а какие-то -- к графовым характеристикам. Если концептуальное различие между оптимизатором и композером именно в этом -- тогда понимаю.
e9e0519
to
45664fa
Compare
n_jobs, start_depth, show_progress: PipelineComposerRequirements -> ComposerRequirements duplicated max_pipeline_fit_time: drop from pipeline_composer_requirements.py
…rams Move most of GraphOptimizerParams into ComposerRequirements. Make the former a dataclass
8b33ed4
to
d014ba6
Compare
6f64e54
to
6b5798e
Compare
6b5798e
to
44bc34e
Compare
Reorganize ComposerRequirements & GraphOptimiserParameters to be more intuitive and logical.
Main changes
with_history
in ComposerBuilder by defaultSo, all in all, I hope, it's now a bit more straightforward to define parameters in fedot. Mainly users should look for PipelineComposerRequirements & ComposerBuilder methods.