You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
circom version 2.1.4 and snarkjs version 0.6.8 were used.
The circom source code looks like this,the goal is to achieve a linear regression proof,
pragma circom 2.1.4; ``
template linear(N) {
signal input X[N];
signal input y[N];
signal mid_w;
signal mid_b;
var lr = 1/10000;
var w = -1/10;
var b = 3;
var y_hat;
var det_w;
var det_b;
var temp;
signal output w_result;
signal output b_result;
var X_train[N];
var y_train[N];
var epoches = 100;
for(var i=0;i<N;i++){
X_train[i] = X[i];
y_train[i] = y[i];
}
for(var i = 0;i < epoches;i++){
var sum_w = 0;
var sum_b = 0;
for(var j= 0;j<N;j++){
y_hat = w * X_train[j] + b ;
temp = y_train[j] - y_hat;
sum_w = temp * (-X_train[j]) + sum_w;
sum_b = temp * (-1) + sum_b;
}
det_w = 2 * sum_w;
det_b = 2 * sum_b;
w = w - lr * det_w;
b = b - lr * det_b;
}
mid_w <-- w;
mid_b <-- b;
w_result <== mid_w;
b_result <== mid_b;
}
component main = linear(30);``
Then I ran the following command as prompted by snarkjs,
The above commands are all copied and pasted snarkjs, and the circom source code can be compiled correctly, but an error is reported when executing "snarkjs groth16 prove circuit_final.zkey witness.wtns proof.json public.json".
The text was updated successfully, but these errors were encountered:
circom version 2.1.4 and snarkjs version 0.6.8 were used.
The circom source code looks like this,the goal is to achieve a linear regression proof,
Then I ran the following command as prompted by snarkjs,
The above commands are all copied and pasted snarkjs, and the circom source code can be compiled correctly, but an error is reported when executing "snarkjs groth16 prove circuit_final.zkey witness.wtns proof.json public.json".
The text was updated successfully, but these errors were encountered: