mirror of
https://github.com/socathie/circomlib-ml.git
synced 2026-01-11 15:07:56 -05:00
* add circuits and tests for separable convolution. Circuits do not yet comply with repo`s quantization * make depthwise circuit compliant with quantization method from repo * make pointwise circuit compliant with quantization method from repo * separable convolution test works * clean up * fix typos and skip failing test * clean up duplicated code for depthwise conv * clean up duplicated code for pointwise conv * clean up duplicated code for separable conv notebook * chore: update filename to capital case --------- Co-authored-by: drCathieSo.eth <socathie@users.noreply.github.com>
26 lines
833 B
JavaScript
26 lines
833 B
JavaScript
const chai = require("chai");
|
|
const path = require("path");
|
|
|
|
const wasm_tester = require("circom_tester").wasm;
|
|
|
|
const F1Field = require("ffjavascript").F1Field;
|
|
const Scalar = require("ffjavascript").Scalar;
|
|
exports.p = Scalar.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617");
|
|
const Fr = new F1Field(exports.p);
|
|
|
|
const assert = chai.assert;
|
|
|
|
describe("BatchNormalization layer test", function () {
|
|
this.timeout(100000000);
|
|
|
|
it("(5,5,3) -> (5,5,3)", async () => {
|
|
const INPUT = require("../models/batchNormalization_input.json");
|
|
|
|
const circuit = await wasm_tester(path.join(__dirname, "circuits", "BatchNormalization_test.circom"));
|
|
|
|
const witness = await circuit.calculateWitness(INPUT, true);
|
|
|
|
assert(Fr.eq(Fr.e(witness[0]),Fr.e(1)));
|
|
});
|
|
});
|