-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Retiarii] Rename APIs and refine documentation #3404
Conversation
docs/en_US/NAS/retiarii/Tutorial.rst
Outdated
|
||
Create a Trainer and Exploration Strategy | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
Create a Evaluator and Exploration Strategy |
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.
a -> an
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.
i will revise the doc in another pr
@@ -0,0 +1,2 @@ | |||
from .base import PyTorchImageClassificationTrainer, PyTorchMultiModelTrainer |
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.
why not change Trainer
to Evaluator
?
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.
The base file is deprecated. These are not public APIs.
|
||
|
||
class Lightning(TrainingConfig): | ||
class Lightning(ModelEvaluator): |
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.
what is the difference between ModelEvaluator
, Evaluator
and Trainer
?
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.
Renamed modelevaluator -> evaluator. Trainer is a concept in oneshot only.
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.
Maybe we can deprecate the concept of trainer and rename DartsTrainer -> DARTS, EnasTrainer -> ENAS? Leave that for discussion.
if model_id not in evaluator_slot: | ||
phy_model.evaluator.kwargs['model_kwargs'].append(new_node.graph.model.evaluator.kwargs.copy()) | ||
evaluator_slot[model_id] = len(phy_model.evaluator.kwargs['model_kwargs']) - 1 | ||
slot = evaluator_slot[model_id] | ||
phy_model.evaluator.kwargs['model_kwargs'][slot]['model_id'] = model_id | ||
phy_model.evaluator.kwargs['model_kwargs'][slot]['use_input'] = False | ||
phy_model.evaluator.kwargs['model_kwargs'][slot]['use_output'] = False | ||
else: | ||
slot = training_config_slot[model_id] | ||
slot = evaluator_slot[model_id] | ||
# If a model's inputs/outputs are not used in the multi-model | ||
# the codegen and trainer should not generate and use them | ||
# "use_input" and "use_output" are used to mark whether | ||
# an input/output of a model is used in a multi-model | ||
if new_node.operation.type == '_inputs': | ||
input_slot_mapping[new_node] = slot | ||
phy_model.training_config.kwargs['model_kwargs'][slot]['use_input'] = True | ||
phy_model.evaluator.kwargs['model_kwargs'][slot]['use_input'] = True | ||
if new_node.operation.type == '_outputs': | ||
output_slot_mapping[new_node] = slot | ||
phy_model.training_config.kwargs['model_kwargs'][slot]['use_output'] = True | ||
phy_model.evaluator.kwargs['model_kwargs'][slot]['use_output'] = True |
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.
@hzhua could you please help review this part?
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.
No problem if evaluator has the same structure with training_config.
No description provided.