Open
Conversation
ddkang
reviewed
Aug 20, 2023
| @@ -0,0 +1,45 @@ | |||
| use std::{collections::HashMap, rc::Rc, vec}; | |||
Owner
There was a problem hiding this comment.
Why do you need this as a separate layer? Is it not fused?
ddkang
reviewed
Aug 20, 2023
src/utils/loader.rs
Outdated
| for tensor in inp { | ||
| model.tensors.push(tensor); | ||
| model.tensors.push(tensor.clone()); | ||
| // println!("tensor: {:?}", tensor); |
Owner
There was a problem hiding this comment.
There's tons of extraneous changes. Clean them up.
ddkang
reviewed
Aug 20, 2023
| @@ -0,0 +1,302 @@ | |||
| # Oggn | |||
Owner
There was a problem hiding this comment.
Turn this into the way that the other converter is written with a class and a main function
ddkang
reviewed
Aug 21, 2023
| struct.pack_into('q', shape, 0, -1) | ||
| init.raw_data = bytes(shape) | ||
|
|
||
| onnx.save(model, "/Users/siddharthaalluri/Desktop/sid-alluri/zkml/python/onnx_converter/new_mnist.onnx") |
| params = [kernel[0], kernel[1], stride[0], stride[1]] | ||
|
|
||
| elif node.op_type == "Relu": | ||
| layer_type = "ReLUONNX" |
Owner
There was a problem hiding this comment.
Why is there a separate ReluONNX layer?
| output_dim = get_output_dim(node_id, model_graph) | ||
| params = [] | ||
|
|
||
| elif node.op_type == "Gemm": |
Owner
There was a problem hiding this comment.
Does this work for all forms of Gemm?
| "layer_type": layer_type, | ||
| "params": params, ## Change params HELP HELP HELP HELP | ||
| "inp_shapes": inputs_dim, | ||
| "inp_idxes": inp_idxes, ### RANDOM COME BACK HERE HELP HELP HELP HELP |
src/layers.rs
Outdated
| pub mod squared_diff; | ||
| pub mod tanh; | ||
| pub mod update; | ||
| pub mod relu; |
Owner
There was a problem hiding this comment.
Use the rust extension to sort imports.
src/layers/dag.rs
Outdated
| tanh::TanhChip, | ||
| update::UpdateChip, | ||
| update::UpdateChip, | ||
| relu::ReluLayerChip, |
Owner
There was a problem hiding this comment.
Move ReLU to the non-linear diretory
src/layers/fully_connected.rs
Outdated
| ) -> Array<Value<F>, IxDyn> { | ||
| assert_eq!(input.ndim(), 2); | ||
| assert_eq!(weight.ndim(), 2); | ||
| println!("input shape: {:?}", input.shape()); |
src/layers/layer.rs
Outdated
| Tanh, | ||
| Transpose, | ||
| Update, | ||
|
|
src/layers/max_pool_2d.rs
Outdated
| let (sx, sy) = (sx as usize, sy as usize); | ||
|
|
||
| // Only support batch size 1 for now | ||
|
|
src/utils/loader.rs
Outdated
|
|
||
| model | ||
| } | ||
| } No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Converts an onnx model into the .msgpack. Current functionality: converts a simple mnist onnx model.
To run:
cargo build --release./target/release/time_circuit python/onnx_converter/first_transformed_onnx.msgpack examples/mnist/inp.msgpack kzg