-
Notifications
You must be signed in to change notification settings - Fork 1.8k
pdarts implementation (export is not included) #1730
Conversation
@@ -109,11 +112,12 @@ def forward(self, optional_inputs, semantic_labels=None): | |||
"Length of the input list must be equal to number of candidates." | |||
if semantic_labels is None: | |||
semantic_labels = ["default_label"] * self.n_candidates | |||
out, mask = self.mutator.on_forward(self, optional_inputs, semantic_labels) | |||
out, mask = self.mutator.on_forward( | |||
self, optional_inputs, semantic_labels) |
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?
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.
Auto format. We can use same tool (vs code?), or have the same line width setting.
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.
You might need to set line width to 140, which is defined in our pylint.
def __repr__(self): | ||
return "{} ({})".format(self.name, self.key) | ||
# def __repr__(self): | ||
# return "{} ({})".format(self.name, self.key) |
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.
Can you do a better repr instead of delete it?
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 default repr is good enough, it's easy to compare with original network structure.
If we want some additional information, it can be another side method.
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.
Then delete it instead of commenting.
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.
removed
from torch import nn as nn | ||
|
||
|
||
class RankedModule(nn.Module): |
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 RankedModule?
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.
like cell, it marks difference rank/level of group. for example, in darts, cell is rank=1, and ops can be treat like rank=2. It can support macro/micro pattern better.
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.
Where is this rank/level
used?
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 thought to update on existing network for pdarts implementation, so added it. But finally, to get exact implementation, the pdarts recreate network each time. So it's not used in this time, but I believe it's a good mark for future implementation.
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.
Looks "over-engineering" to me. I'm fine with it. Just make everything clear in the docstring. :)
No description provided.