Closed wzj-651123 closed 1 year ago
The map*.dat files are the archive*.dat files generated with pymap_elites, just with a different filename. You can find the meaning of each line in the map/archive files here, and for the log files here.
How does pymapelites generate archive*.dat? (Is it generated using “multitask.py”?) I did a global search for "archive" and didn't find the path to save this.
For our work it is generated using the cvt.py variant of pymap_elites not multitask.py. You cannot specify an archive location, the archive file will simply be saved in the same directory you are running cvt_map_elites.compute(...)
from. Maybe have a look at the basic usage section in the pymap_elites readme with the rastrigin function to understand how it works and where the log and archive files are saved.
Then there are 45 numbers in one line in the map*.dat file. Are these the control signals for the robot? What does each mean? Can it be understood that 45 numbers in a row are a controller, and the number of rows in the map*.dat file is the number of generated controllers?
For each line the first value is the fitness of that particular gait (distance walked along x axis), the next 6 values are the centroid (location in the map), the next 6 are the descriptor for that gait (percentage of time each leg spends on the ground), and the final 32 values are the parameters for the gait controller. The number of rows is determined by the map size (number of centroids).
The map_.py in the article is a 2000045 list. I used pymap_elites to generate a map_*.py file of the same size, but it cannot be called normally in test_gait.py. The value of fitness in the map I generated is about a few hundred, but your fitness size is all less than 10. When generating a map, can the size of the values in it be controlled?
A fitness value of a few hundred doesn't sound correct. The fitness value is the distance travelled along the x axis in 5s which should definitely be below 10m. Maybe make sure you are only running the simulation for 5s. test_gait.py will help to see the gaits and debug any issues. All of the values have physical meaning so their sizes depend on their units.
In the process of generating maps now, I just randomly generate a lot of values, which have nothing to do with the robot model. So, how do you use the robot model to calculate the controller parameters and fitness values in the map?
That's good, nice! So the way Map Elites works is it passes 32 parameters to the gait controller which produces a particular gait. This gait is simulated in the pybullet physics simulation and returns a fitness parameter and a behaviour descriptor. This process is iteratively repeated to find gaits with better and better fitness values, whilst also being sufficiency different based on the behaviour descriptor. What you get in the end is a set of diverse gaits which also all have high fitness values, with the map size determining the number of gaits. That is why Map Elites is referred to as a quality diversity (QD) algorithm as it produces both high quality and different/diverse solutions.
Those values being generated have everything to do with the robot model. The robot model is used to simulate a gait. Map Elites passes 32 parameters to the gait controller and simulator and then based on how the robot walks you will get out a fitness value and behaviour descriptor. If you change the robot model and make it heavier or give it shorter legs, it will walk differently and your fitness and behaviour descriptor values will now be different even with the same gait parameters. If I'm not explaining this well enough, please go and have a look through the paper Robots that can adapt like animals. They do a really good job explaining all of the questions you've had.
When you generated the map, how did you combine the robot model? In the 2015 paper, it seems that the C++ language is used to do this? I'm a little bit confused now what should I do with this generation process?
So Map Elites requires a function which given a set of parameters, returns a fitness and descriptor.
function(x) -> fitness, descriptor
The function evaluate_gait
in the file generate_map.py does this. Inside this function I create a controller with the parameters x
and pass this to the PyBullet simulator which simulates the gait and returns a fitness. I also determine the descriptor from the foot contact sequence. Both of these then get returned to Map Elites. This is how the robot model is combined with map generation.
Hi is everything working? Can I close this issue?
How to generate the map*.dat? In the process of reproducing your work, we did not find the generated file of the map.dat and log_.dat. We want to know the meaning of each number in the map*.dat and log*.dat. Looking forward to your reply.