schrum2 / MM-NEATv2

MM-NEAT version 2.0 is no longer supported. Please get MM-NEAT 3+ from https://github.com/schrum2/MM-NEAT
Other
11 stars 5 forks source link

General substrate configuration options #394

Closed schrum2 closed 7 years ago

schrum2 commented 7 years ago

I would like you to provide more substrate configuration options for the microRTS task, but I realized that this is actually a more general task. Substrates for many domains can essentially be configured according to a few basic parameters. Make static methods in the HyperNEATUtil class that take several parameters and return the substrate list and the connections list needed by HyperNEAT tasks. Here are specifics.

These are the parameters that are needed to create the list of substrates: Input width/height (also width height of each processing substrate) Number of input substrates Processing Depth: number of processing layers that are stacked between input and output Processing Width: number of side-by-side processing layers at each depth level

This method should return a list of only input and hidden/processing substrates. Output substrate configurations are specialized enough that they should still be added at the end according to the specific task.

Here are the parameters needed to create the list of substrate connectivity pairs (technically Triples now ... see below): Number of input substrates Processing Depth: number of processing layers that are stacked between input and output Processing Width: number of side-by-side processing layers at each depth level

All inputs should be connected to processing substrates in the first depth layer (if there is one) and all processing substrates at one depth connect to all processing substrates one level up. Each Triple stores the String name of the source substrates, the String name of the target substrate, and a Boolean value indicating whether or not convolution is possible ... a new feature that I am currently focusing on. You should use Boolean.TRUE for all of these layers.

After you make this method in HyperNEATUtil, let me know, and I'll indicate what to do next.

You can find an example of how to configure the substrates in this fashion in the HyperNEATTetrisTask ... I recently wrote this code, but just realized that it should be more general and not apply only to Tetris. However, do not change any of the code in the HyperNEATTetrisTask (I'll do that eventually). Also, note that the code in this class is more complicated than what I am asking you to write because it also has special cases that your simpler code will not have.

schrum2 commented 7 years ago

For the getSubstrateConnectivityExceptOutputs method, add a parameter that is a List of Strings containing the names of all output substrates. This will allow this method to also define these connectivity patterns.

If the "extraHNLinks" parameter is true, then all input substrates should be connected to all output substrates (see HyperNEATTetrisTask).

If there are any processing layers, then every processing layer at the top depth should be connected to every output substrate.

Lastly, note that connection Triples to all output substrates should use Boolean.FALSE in the final slot, indicating that convolution is not allowed.

schrum2 commented 7 years ago

My commit above and the issue comment above that indicate that the output layers should be included after all.

DarwinJohnson commented 7 years ago

The getSubstrateInformation and getSubstrateConnectivity methods in the HyperNEATUtil class are finalized and have been tested. Unless further confirmation is needed, I think this Issue can be closed.

schrum2 commented 7 years ago

Keep open for now. I want @alicequint to use this code to replace her substrate construction in the microRTS task, and I want @DarwinJohnson to use this code to replace substrate construction in the board game tasks. I will take care of calling these methods for Tetris.

Note: You need to make two command line integer parameters first: hyperNEATProcessingDepth and hyperNEATProcessingWidth These correspond to the similarly named method parameters in the methods you just wrote.

schrum2 commented 7 years ago

I've successfully made Tetris use the new substrate configuration functions ... you can look at that code if you need to see example usage.

Also, there are some more tasks that I want you to switch over to using these new methods: For @alicequint : Make the MarioTask and the TorusPredPrey use the new methods (in addition to MicroRTS).

Both Mario and TorusPredPrey should compute the substrate information once and save it in a global variable that is re-used (compare with HyperNEATTetrisTask). However, MicroRTS cannot do this, because the increasing map sizes means that different size substrates are needed depending on the map. Also note that Mario sets some output neurons to be "dead". You will need to use the new HyperNEATUtil methods like normal, but then modify the designated output substrates (add the dead neurons) within the result list that is returned.

For @DarwinJohnson : Make ALL VizDoom tasks use the new methods (in addition to BoardGames)

As with Tetris, Mario, and TorusPredPrey, these domains should compute the substrate information once, save it in a global variable, and then re-use that variable. Note that in VizDoom, each subtask has a method that adds the output substrates, and output connections. Replace these methods with new methods that return the List of String outputNames and List of Triples output that are expected by your new methods. Once DefendTheCenter has this new code in place, I have some new ideas regarding #325

For all of these domains, don't worry about maintaining the names of the input substrates, or the substrate coordinates.

schrum2 commented 7 years ago

@alicequint and @DarwinJohnson need to talk with each other to decide if this issue can be closed.

alicequint commented 7 years ago

darwin and i decided this could be closed