BerkeleyLearnVerify / VerifAI

VerifAI is a software toolkit for the formal design and analysis of systems that include artificial intelligence (AI) and machine learning (ML) components.
BSD 3-Clause "New" or "Revised" License
170 stars 47 forks source link

Bug in Basic Usage Method 1 #33

Closed StevenCHowell closed 2 years ago

StevenCHowell commented 2 years ago

The Method 1 example of the Basic Usage Documentation creates a dictionary from three instances of the verifai.features.features.Struct class, then uses that dictionary to instantiate a verifai.samplers.feature_sampler.LateFeatureSampler object by calling the randomSampleFor method of the verifai.samplers.feature_sampler.FeatureSampler class. Instantiating the LateFeatureSampler method results in an error when trying to access the domains attribute of the input dictionary.

I cannot reconcile what this domains attribute is meant to be, as the three dictionary keys in the example are 'control_params', 'env_params', and 'cones_config'. I wondered if it meant to be accessing the 'domain' key, but that is not one of the options.

How is this example meant to function?

abadithela commented 2 years ago

Same issue. Have you found a solution to this yet?

dfremont commented 2 years ago

Thanks for catching this, and apologies for the very slow reply! I'm not sure how that example got messed up, but the code was wrong: the Structs need to be used to define Features, then those need to be put into a FeatureSpace, not a plain dict. I've updated the documentation.