refactor: split input and witness data types (#334)

This commit is contained in:
dante
2023-06-30 03:55:27 +01:00
committed by GitHub
parent 2180e0f19c
commit 4e350ec06c
19 changed files with 459 additions and 661 deletions

View File

@@ -153,10 +153,8 @@ def test_forward():
with open(output_path, "r") as f:
data = json.load(f)
assert data["input_data"] == res["input_data"] == [[0.05326242372393608, 0.07497056573629379, 0.05235547572374344, 0.028825461864471436, 0.05848702788352966,
0.008225822821259499, 0.07530029118061066, 0.0821458026766777, 0.06227986887097359, 0.024306034669280052, 0.05793173983693123, 0.040442030876874924]]
assert data["output_data"] == res["output_data"] == [[0.05322265625, 0.12841796875, 0.0751953125, 0.10546875, 0.20947265625, 0.10400390625, 0.05224609375, 0.0810546875, 0.02880859375, 0.05859375, 0.06689453125,
0.00830078125, 0.1337890625, 0.22412109375, 0.09033203125, 0.0751953125, 0.1572265625, 0.08203125, 0.0625, 0.0869140625, 0.0244140625, 0.12060546875, 0.185546875, 0.06494140625, 0.05810546875, 0.0986328125, 0.04052734375]]
assert data["input_data"] == res["input_data"]
assert data["output_data"] == res["output_data"]
assert data["processed_inputs"]["poseidon_hash"] == res["processed_inputs"]["poseidon_hash"] == [[
8270957937025516140, 11801026918842104328, 2203849898884507041, 140307258138425306]]
@@ -452,8 +450,16 @@ async def aggregate_and_verify_aggr():
proof_path = os.path.join(folder_path, '1l_relu.pf')
output_path = os.path.join(
folder_path,
'1l_relu_aggr_witness.json'
)
res = ezkl_lib.gen_witness(data_path, model_path,
output_path, settings_path=settings_path)
ezkl_lib.prove(
data_path,
output_path,
model_path,
pk_path,
proof_path,
@@ -540,8 +546,16 @@ async def evm_aggregate_and_verify_aggr():
proof_path = os.path.join(folder_path, '1l_relu.pf')
output_path = os.path.join(
folder_path,
'1l_relu_aggr_evm_witness.json'
)
res = ezkl_lib.gen_witness(data_path, model_path,
output_path, settings_path=settings_path)
ezkl_lib.prove(
data_path,
output_path,
model_path,
pk_path,
proof_path,