jara001 / ng_trajectory

Racing Line Optimization using Nevergrad
GNU General Public License v3.0
5 stars 4 forks source link

Centerline penalizer evaluation #32

Open jara001 opened 2 years ago

jara001 commented 2 years ago

In 04ed669f92f99f2a7c3707d6b7a4314d837ceabe new methods for centerline penalizer were added. Currently, there are four methods:

This means, that all invalid points are paired with the appropriate subsequence of the centerline, finding the longest distance the invalid point and centerline. Then, a method is used to compute the penalty.

To evaluate the methods, following experiment was performed:

Even though the budget is quite small, the goal was to find if the method is "pushed" towards a good solution. Therefore, it is successful when a valid solution is found within the budget.

Results were:

According to this, we can omit min method.

jara001 commented 2 years ago
{
    "_version": 2,
    "_comment": "Example of configuration file for Matryoshka mapping.",
    "loops": 40,
    "groups": 8,
    "interpolator": "cubic_spline",
    "segmentator": "flood_fill",
    "selector": "uniform",
    "selector_init": {
        "distance": 0.1,
        "overlap": 100,
        "rotate": 0.7
    },
    "penalizer": "centerline",
    "variate": "method",
    "method": ["min", "max", "sum", "avg"],
    "cascade": [
        {
            "algorithm": "matryoshka",
            "budget": 100,
            "layers": 5,
            "criterion": "profile",
            "criterion_args": {
                "overlap": 100
            },
            "criterion_init": {
                "_dummy": 0
            }
        }
    ],
    "start_points": "ng_start_points_torino2.npy",
    "valid_points": "ng_valid_points_torino2.npy",
    "logging_verbosity": 2,
    "hold_map": true,
    "plot": true,
    "plot_args": [
        {
            "_figure": {
                "function": "axis",
                "_args": [ "equal" ]
            },
            "trackPlot": [ "@track" ]
        },
        {
            "pointsPlot": {
                "_args": [ "@result" ]
            },
            "pointsScatter": {
                "_args": [ "@rcandidate" ]
            }
        }
    ],
    "prefix": "penalizer_test"
}
jara001 commented 2 years ago

After some discussion with Tonda, a Huber loss support was added in c67a223eb12035ed5edcb3aad2ed5792524e8eb5.

The methods are still the same, but the their input data are treated with Huber first.

I have tested Huber loss on two cases, with delta = 2.0 and delta = 4.0. However, the results were not nice: