Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/gizatechxyz/orion into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
raphaelDkhn committed Dec 21, 2023
2 parents b59b9be + 5e5634f commit 63c0a8c
Show file tree
Hide file tree
Showing 103 changed files with 4,323 additions and 19 deletions.
8 changes: 8 additions & 0 deletions docgen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ fn main() {
let trait_name: &str = "TreeEnsembleRegressorTrait";
doc_trait(trait_path, doc_path, label);
doc_functions(trait_path, doc_path, trait_name, label);

// LINEAR REGRESSOR DOC
let trait_path = "src/operators/ml/linear/linear_regressor.cairo";
let doc_path = "docs/framework/operators/machine-learning/linear-regressor";
let label = "linear_regressor";
let trait_name: &str = "LinearRegressorTrait";
doc_trait(trait_path, doc_path, label);
doc_functions(trait_path, doc_path, trait_name, label);
}

fn doc_trait(trait_path: &str, doc_path: &str, label: &str) {
Expand Down
Binary file added docs/.gitbook/assets/ORION_tutorial (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/.gitbook/assets/ORION_tutorial (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/accuracy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/forecasts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/tutorial#1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/tutorial#2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/tutorial#3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/tutorial#5 (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/.gitbook/assets/tutorial#5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased] - 2023-12-14

## Added
- Gather ND Operator.

## [Unreleased] - 2023-12-01

## Added
Expand Down
2 changes: 2 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
* [tensor.reduce\_l1](framework/operators/tensor/tensor.reduce\_l1.md)
* [tensor.reduce\_prod](framework/operators/tensor/tensor.reduce\_prod.md)
* [tensor.gather\_elements](framework/operators/tensor/tensor.gather\_elements.md)
* [tensor.gather\_nd](framework/operators/tensor/tensor.gather\_nd.md)
* [tensor.sequence\_length](framework/operators/tensor/tensor.sequence\_length.md)
* [tensor.sequence\_at](framework/operators/tensor/tensor.sequence\_at.md)
* [tensor.reduce\_min](framework/operators/tensor/tensor.reduce\_min.md)
Expand Down Expand Up @@ -155,3 +156,4 @@
* [Verifiable Linear Regression Model](academy/tutorials/verifiable-linear-regression-model-in-orion.md)
* [Verifiable Support Vector Machine](academy/tutorials/verifiable-support-vector-machine.md)
* [Verifiable Principal Components Analysis](academy/tutorials/verifiable-principal-components-analysis.md)
* [Provable MLR: Forecasting AAVE's Lifetime Repayments](academy/tutorials/provable-mlr-forecasting-aaves-lifetime-repayments.md)
6 changes: 6 additions & 0 deletions docs/academy/tutorials/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Learn how to use Orion with tutorials. We encourage you to contribute by sharing your own tutorial.

## [Provable Multiple Linear Regression Solver: Forecasting AAVE's Lifetime Repayments](provable-mlr-forecasting-aaves-lifetime-repayments.md)

For this particular tutorial, we will build a Closed-Form Multiple Linear Regression algorithm and use it to forecast AAVE's (WETH Pool) future projected Lifetime Repayments as a practical example. Towards the second half-end of the tutorial, we will convert the model to Cairo enabling us to make the entire MLR system as well as the forecasts fully provable & verifiable.

_December 21, 2023 - Bem Baraki_

## [Verifiable Principal Components Analysis](verifiable-principal-components-analysis.md)

The Principal Component Analysis (PCA) method is an unsupervised learning algorithm that aims to reduce the dimensionality of a dataset consisting of a large number of interrelated variables, while at the same time preserving as much of the variation present in the original dataset as possible.
Expand Down
2 changes: 1 addition & 1 deletion docs/academy/tutorials/implement-new-operators-in-orion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Implement new operators in Orion

<figure><img src="../../.gitbook/assets/article_header_ORION.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../../.gitbook/assets/tutorial#2.png" alt=""><figcaption></figcaption></figure>

The Orion Framework offers an open-source ONNX runtime implementation for Validity and ZK Machine Learning. Are you interested in contributing? We sincerely appreciate your interest. This is exactly how we'll build a robust and transparent AI ecosystem! In this tutorial, you'll learn how to contribute to the [Orion repository](https://github.com/gizatechxyz/orion) by implementing from scratch a new operator.

Expand Down
4 changes: 2 additions & 2 deletions docs/academy/tutorials/mnist-classification-with-orion.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MNIST Classification with Orion

<figure><img src="../../.gitbook/assets/photo_2023-06-14_13-50-17.jpg" alt=""><figcaption></figcaption></figure>
<figure><img src="../../.gitbook/assets/tutorial#1.png" alt=""><figcaption></figcaption></figure>

Orion is a dedicated Cairo-based library designed specifically to build machine learning models for ValidityML. Its purpose is to facilitate verifiable inference. For better performance we will operate with an 8-bit quantized model. In this tutorial, you will be guided on how to train your model using Quantized Aware Training using MNIST dataset, how to convert your pre-trained model to Cairo 1, and how to perform inference with Orion.

Expand Down Expand Up @@ -537,7 +537,7 @@ fn fc1(i: Tensor<i32>, w: Tensor<i32>, b: Tensor<i32>) -> Tensor<i32> {

#### Dense Layer 2

In a similar way, we can build the second layer `fc2`, which contains a [Linear](../../framework/operators/neural-network/nn.linear.md) function and a [Softmax](../../framework/operators/neural-network/nn.softmax.md) from [NNTrait](../../framework/operators/neural-network/). We could convert the tensor to fixed point in order to perform softmax, but for this simple tutorial it's not necessary.&#x20;
In a similar way, we can build the second layer `fc2`, which contains a [Linear](../../framework/operators/neural-network/nn.linear.md) function and a [Softmax](../../framework/operators/neural-network/nn.softmax.md) from [NNTrait](../../framework/operators/neural-network/). We could convert the tensor to fixed point in order to perform softmax, but for this simple tutorial it's not necessary.

```rust
use orion::operators::tensor::core::Tensor;
Expand Down
Loading

0 comments on commit 63c0a8c

Please sign in to comment.