Skip to content

Question regarding the choice of repair parameters. #11

Description

@zhe-tao

The interface exposes two repair parameters, namely n and num_core:

def PNN_MNIST(repair_num, n, num_core, remove_redundant_constraint=False):

Regarding n, how would the user determine it? Is n=0.5 as used in PNN_MNIST.py always a reasonable choice?

PNN_MNIST(num, 0.5, num_core=10, remove_redundant_constraint=False)

Regarding num_core, considering it actually controls the number of buggy inputs to be repaired in parallel, would os.cpu_count() always be a reasonable choice?

pool = multiprocessing.Pool(core_num)
if self.buggy_points is not None:
arg_list = [[self.buggy_points[i], self.P[i], self.ql[i], self.qu[i], is_gurobi] for i in
range(len(self.buggy_points))]
res = pool.starmap(self.PatchForOnePoint, arg_list)
else:
arg_list = [[self.linear_regions[i][0], self.linear_regions[i][1], self.linear_regions[i][2], self.P[i],
self.ql[i], self.qu[i]] for i in range(len(self.linear_regions))]
res = pool.starmap(self.PatchForOneLinearRegion, arg_list)
pool.close()
g_list, cd_list = [res_g[0] for res_g in res], [res_g[1] for res_g in res]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions