schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Save image of evolved Neural Network #53

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

Save an image of the evolved neural network at the end of a fitness-based evolutionary run

alejmedinajr commented 2 years ago

To use visualization function for this, graphviz needs to be installed, however, Mark is currently not here so waiting off on that.

schrum2 commented 2 years ago

You can view the generated neural network graphs at https://dreampuf.github.io/GraphvizOnline. Just paste the text of the file into the site. image However, this reveals that the neurons are not being labelled correctly in our code, since you're still using the labels from the pole balancing example this was copied from.

The input neuron labels should be: x, y, z, radius, bias

The output labels depend on other settings. The first is always "presence". The next outputs should be the names of the block types that each output corresponds to. If orientations are being evolved (ask @MuellMark ) then those come next (Each would be "oriented " then the direction, like "oriented north"). If a snake is being evolved, then the directions show up again, either in addition to or instead of the orientation directions. These labels should be "move north", etc. With snakes, the last output is "continue snake"

The graph may not look very good with these long node names. We may need to abbreviate.

alejmedinajr commented 2 years ago

Changed the input/output labels. I have included examples of different command line parameters below. Also the actual part that saves the file has been commented out because it causes issues since graph viz is not installed (the file will not be created and saved unless this line is uncommented).

When only having block type and snake outputs: graphviz (3)

When having block type, snake, and orientation outputs: graphviz (2)

When having only block type outputs: graphviz (1)

When having block type and orientation outputs: graphviz

alejmedinajr commented 2 years ago

Made some of the names shorter, and changed to 0 based indexing labels. Also just to clarify, the neural network being produced is at the end of evolution, and is the champion genome's neural network.

New shorter names and zero based indexing labels example: graphviz (4)