-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: init train v2 #308
base: main
Are you sure you want to change the base?
feat: init train v2 #308
Conversation
ab9bb2a
to
906650a
Compare
dc28e33
to
7bdae0f
Compare
@@ -27,11 +27,11 @@ def add_node(self, node: TNode) -> Self: | |||
self.nodes[node.id] = node | |||
return self | |||
|
|||
def add_edge(self, from_id: NodeID, to_id: NodeID) -> Self: | |||
def add_edge(self, from_id: NodeID, to_id: NodeID, **kwargs) -> Self: |
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.
docstring? intention behind kwargs ... different properties based on type of edge etc?
@@ -49,6 +49,15 @@ def get_successors(self, node_id: NodeID, recursively=False) -> List[NodeID]: | |||
else: | |||
return list(self.graph.successors(node_id)) | |||
|
|||
def get_successor(self, node_id: NodeID) -> NodeID: |
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.
Current limitation that we want to have now, or always, to use "crossovers" when there are more than 1?
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.
Not always, currently it's used when it's supposed to only be one, but we could of course just use get_successors()[0]. I was thinking we could have both get_successor and get_successors. I think we already have both for either successors or predecessors.
@@ -58,6 +67,10 @@ def get_predecessor(self, node_id: NodeID) -> NodeID: | |||
) | |||
return predecessors[0] | |||
|
|||
def get_predecessors(self, node_id: NodeID) -> List[NodeID]: |
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 > 1 here?
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.
It's probably easier to see that by looking at where it's used. get_predecessors is used to get all consumers connected to a driver, get_successor is used to get driver for consumer.
Why is this pull request needed?
Initialize the work on a common train, where the features of all current train-models should be handled.