The Generator

Most interactions with HAWKS are through the creation of a BaseGenerator object. This is typically done by passing a config to hawks.generator.create_generator(), which then creates the appropriate child-class of BaseGenerator. This is determined by the "mode" parameter, which at present can only take "single" as an option (to create a SingleObjective object).

This can be seen in each of the Examples. Further documentation on this generator can be found at hawks.generator, along with more details on the parameters given to it on the Parameters page.

At it’s simplest, we can create datasets using default values (seen in Defaults) by the following code:

import hawks

gen = hawks.create_generator()
gen.run()

For giving parameters other than the defaults, we can pass in the parameters either using a dict or path to a JSON file.

The example below passes in a dict directly to give a different silhouette width target.

import hawks

gen = hawks.create_generator({
    "objectives": {
        "silhouette": {
            "target": 0.6
        }
    }
})
gen.run()

Or, just giving a path to a JSON file (an example of which is the Defaults)

import hawks

gen = hawks.create_generator("path/to_the/config.json")
gen.run()