Skip to content
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

Fix FeedForwardNetwork and output bug #282

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Finebouche
Copy link

  • Fix FeedForwardNetwork wrong creation, where some useless node were use to create the network and some usufull ones were disregarded
  • and remove the possibility for the ouput to be an input to a new node

@@ -341,7 +341,7 @@ def mutate_add_connection(self, config):
possible_outputs = list(self.nodes)
out_node = choice(possible_outputs)

possible_inputs = possible_outputs + config.input_keys
possible_inputs = list((set(self.nodes)- set(config.output_keys)) | set(config.input_keys) )
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes new node from taking output nodes as inputs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removed useless nodes from the FeedForwardNetwork

if n in required and all(a in s for (a, b) in connections if b == n):
t.add(n)
# select connections (a, b) where b == n
connections_to_n = [(a, b) for (a, b) in connections if b == n and a in required]
Copy link
Author

@Finebouche Finebouche May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change here is that a as to be in required nodes to be considered

@@ -38,20 +38,35 @@ def required_for_output(inputs, outputs, connections):
"""
assert not set(inputs).intersection(outputs)

# Create a graph representation of the connections
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous function wasn't working as intended

Copy link

sonarcloud bot commented Dec 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant