Concrete ML
WebsiteLibrariesProducts & ServicesDevelopersSupport
0.5
0.5
  • What is Concrete ML?
  • Getting Started
    • Installation
    • Key Concepts
    • Inference in the Cloud
  • Built-in Models
    • Linear Models
    • Tree-based Models
    • Neural Networks
    • Pandas
    • Built-in Model Examples
  • Deep Learning
    • Using Torch
    • Using ONNX
    • Step-by-Step Guide
    • Deep Learning Examples
    • Debugging Models
  • Advanced topics
    • Quantization
    • Pruning
    • Compilation
    • Production Deployment
    • Advanced Features
  • Developer Guide
    • Workflow
      • Set Up the Project
      • Set Up Docker
      • Documentation
      • Support and Issues
      • Contributing
    • Inner workings
      • Importing ONNX
      • Quantization tools
      • FHE Op-graph design
      • External Libraries
    • API
      • concrete.ml.common
      • concrete.ml.common.check_inputs
      • concrete.ml.common.debugging
      • concrete.ml.common.debugging.custom_assert
      • concrete.ml.common.utils
      • concrete.ml.deployment
      • concrete.ml.deployment.fhe_client_server
      • concrete.ml.onnx
      • concrete.ml.onnx.convert
      • concrete.ml.onnx.onnx_model_manipulations
      • concrete.ml.onnx.onnx_utils
      • concrete.ml.onnx.ops_impl
      • concrete.ml.quantization
      • concrete.ml.quantization.base_quantized_op
      • concrete.ml.quantization.post_training
      • concrete.ml.quantization.quantized_module
      • concrete.ml.quantization.quantized_ops
      • concrete.ml.quantization.quantizers
      • concrete.ml.sklearn
      • concrete.ml.sklearn.base
      • concrete.ml.sklearn.glm
      • concrete.ml.sklearn.linear_model
      • concrete.ml.sklearn.protocols
      • concrete.ml.sklearn.qnn
      • concrete.ml.sklearn.rf
      • concrete.ml.sklearn.svm
      • concrete.ml.sklearn.torch_module
      • concrete.ml.sklearn.tree
      • concrete.ml.sklearn.tree_to_numpy
      • concrete.ml.sklearn.xgb
      • concrete.ml.torch
      • concrete.ml.torch.compile
      • concrete.ml.torch.numpy_module
      • concrete.ml.version
Powered by GitBook

Libraries

  • TFHE-rs
  • Concrete
  • Concrete ML
  • fhEVM

Developers

  • Blog
  • Documentation
  • Github
  • FHE resources

Company

  • About
  • Introduction to FHE
  • Media
  • Careers
On this page
  • API Overview
  • Modules
  • Classes
  • Functions

Was this helpful?

Export as PDF
  1. Developer Guide

API

PreviousExternal LibrariesNextconcrete.ml.common

Last updated 2 years ago

Was this helpful?

API Overview

Modules

  • : Module for shared data structures and code.

  • : Check and conversion tools.

  • : Module for debugging.

  • : Provide some variants of assert.

  • : Utils that can be re-used by other pieces of code in the module.

  • : Module for deployment of the FHE model.

  • : APIs for FHE deployment.

  • : ONNX module.

  • : ONNX conversion related code.

  • : Utility functions for onnx operator implementations.

  • : Some code to manipulate models.

  • : Utils to interpret an ONNX model with numpy.

  • : ONNX ops implementation in python + numpy.

  • : Modules for quantization.

  • : Base Quantized Op class that implements quantization for a float numpy op.

  • : Post Training Quantization methods.

  • : QuantizedModule API.

  • : Quantized versions of the ONNX operators for post training quantization.

  • : Quantization utilities for a numpy array/tensor.

  • : Import sklearn models.

  • : Module that contains base classes for our libraries estimators.

  • : Implement sklearn's Generalized Linear Models (GLM).

  • : Implement sklearn linear model.

  • : Protocols.

  • : Scikit-learn interface for concrete quantized neural networks.

  • : Implements RandomForest models.

  • : Implement Support Vector Machine.

  • : Implement torch module.

  • : Implement the sklearn tree models.

  • : Implements the conversion of a tree model to a numpy function.

  • : Implements XGBoost models.

  • : Modules for torch to numpy conversion.

  • : torch compilation function.

  • : A torch to numpy module.

  • : File to manage the version of the package.

Classes

Functions

: Client API to encrypt and decrypt FHE data.

: Dev API to save the model and then load and run the FHE circuit.

: Server API to load and run the FHE circuit.

: A mixed quantized-raw valued onnx function.

: Base class for quantized ONNX ops implemented in numpy.

: An univariate operator of an encrypted value.

: Base ONNX to Concrete ML computation graph conversion class.

: Post-training Affine Quantization.

: Converter of Quantization Aware Training networks.

: Inference for a quantized model.

: Quantized Abs op.

: Quantized Addition operator.

: Quantized Average Pooling op.

: Quantized Batch normalization with encrypted input and in-the-clear normalization params.

: Brevitas uniform quantization with encrypted input.

: Cast the input to the required data type.

: Quantized Celu op.

: Quantized clip op.

: Quantized Conv op.

: Div operator /.

: Quantized Elu op.

: Quantized erf op.

: Quantized Exp op.

: Quantized flatten for encrypted inputs.

: Quantized Floor op.

: Quantized Gemm op.

: Comparison operator >.

: Comparison operator >=.

: Quantized HardSigmoid op.

: Quantized Hardswish op.

: Quantized Identity op.

: Quantized LeakyRelu op.

: Comparison operator <.

: Comparison operator <=.

: Quantized Log op.

: Quantized MatMul op.

: Quantized Max op.

: Quantized Min op.

: Multiplication operator.

: Quantized Neg op.

: Quantized Not op.

: Or operator ||.

: Quantized PRelu op.

: Quantized Padding op.

: Quantized pow op.

: ReduceSum with encrypted input.

: Quantized Relu op.

: Quantized Reshape op.

: Quantized round op.

: Quantized Selu op.

: Quantized sigmoid op.

: Quantized Neg op.

: Quantized Softplus op.

: Subtraction operator.

: Quantized Tanh op.

: Transpose operator for quantized inputs.

: Where operator on quantized arrays.

: Calibration set statistics.

: Options for quantization.

: Abstraction of quantized array.

: Quantization parameters for uniform quantization.

: Uniform quantizer.

: Mixin class for tree-based classifiers.

: Mixin class for tree-based estimators.

: Mixin class for tree-based regressors.

: Mixin that provides quantization for a torch module and follows the Estimator API.

: A Mixin class for sklearn linear classifiers with FHE.

: A Mixin class for sklearn linear models with FHE.

: A Gamma regression model with FHE.

: A Poisson regression model with FHE.

: A Tweedie regression model with FHE.

: An ElasticNet regression model with FHE.

: A Lasso regression model with FHE.

: A linear regression model with FHE.

: A logistic regression model with FHE.

: A Ridge regression model with FHE.

: Concrete classifier protocol.

: A Concrete Estimator Protocol.

: Concrete regressor protocol.

: Quantizer Protocol.

: A mixin with a helpful modification to a skorch estimator that fixes the module type.

: Scikit-learn interface for quantized FHE compatible neural networks.

: Scikit-learn interface for quantized FHE compatible neural networks.

: Mixin class that adds quantization features to Skorch NN estimators.

: Sparse Quantized Neural Network classifier.

: Implements the RandomForest classifier.

: Implements the RandomForest regressor.

: A Classification Support Vector Machine (SVM).

: A Regression Support Vector Machine (SVM).

: Implements the sklearn DecisionTreeClassifier.

: Implements the sklearn DecisionTreeClassifier.

: Task enumerate.

: Implements the XGBoost classifier.

: Implements the XGBoost regressor.

: General interface to transform a torch.nn.Module to numpy module.

: sklearn.utils.check_X_y with an assert.

: sklearn.utils.check_array with an assert.

: Provide a custom assert to check that the condition is False.

: Provide a custom assert to check that a piece of code is never reached.

: Provide a custom assert to check that the condition is True.

: Generate a proxy function for a function accepting only *args type arguments.

: Return the ONNX opset_version.

: Sanitize arg_name, replacing invalid chars by _.

: Get the numpy equivalent forward of the provided ONNX model.

: Get the numpy equivalent forward of the provided torch Module.

: Compute the output shape of a pool or conv operation.

: Compute any additional padding needed to compute pooling layers.

: Pad a tensor according to ONNX spec, using an optional custom pad value.

: Compute the average pooling normalization constant.

: Clean the graph of the onnx model by removing nodes after the given node name.

: Clean the graph of the onnx model by removing nodes after the given node type.

: Keep the outputs given in outputs_to_keep and remove the others from the model.

: Remove identity nodes from a model.

: Remove unnecessary nodes from the ONNX graph.

: Remove unused Constant nodes in the provided onnx model.

: Simplify an ONNX model, removes unused Constant nodes and Identity nodes.

: Execute the provided ONNX graph on the given inputs.

: Get the attribute from an ONNX AttributeProto.

: Construct the qualified name of the ONNX operator.

: Cast values to floating points.

: Compute abs in numpy according to ONNX spec.

: Compute acos in numpy according to ONNX spec.

: Compute acosh in numpy according to ONNX spec.

: Compute add in numpy according to ONNX spec.

: Compute asin in numpy according to ONNX spec.

: Compute sinh in numpy according to ONNX spec.

: Compute atan in numpy according to ONNX spec.

: Compute atanh in numpy according to ONNX spec.

: Compute Average Pooling using Torch.

: Compute the batch normalization of the input tensor.

: Execute ONNX cast in Numpy.

: Compute celu in numpy according to ONNX spec.

: Return the constant passed as a kwarg.

: Compute cos in numpy according to ONNX spec.

: Compute cosh in numpy according to ONNX spec.

: Compute div in numpy according to ONNX spec.

: Compute elu in numpy according to ONNX spec.

: Compute equal in numpy according to ONNX spec.

: Compute erf in numpy according to ONNX spec.

: Compute exponential in numpy according to ONNX spec.

: Flatten a tensor into a 2d array.

: Compute Floor in numpy according to ONNX spec.

: Compute greater in numpy according to ONNX spec.

: Compute greater in numpy according to ONNX spec and cast outputs to floats.

: Compute greater or equal in numpy according to ONNX spec.

: Compute greater or equal in numpy according to ONNX specs and cast outputs to floats.

: Compute hardsigmoid in numpy according to ONNX spec.

: Compute hardswish in numpy according to ONNX spec.

: Compute identity in numpy according to ONNX spec.

: Compute leakyrelu in numpy according to ONNX spec.

: Compute less in numpy according to ONNX spec.

: Compute less in numpy according to ONNX spec and cast outputs to floats.

: Compute less or equal in numpy according to ONNX spec.

: Compute less or equal in numpy according to ONNX spec and cast outputs to floats.

: Compute log in numpy according to ONNX spec.

: Compute matmul in numpy according to ONNX spec.

: Compute Max in numpy according to ONNX spec.

: Compute Min in numpy according to ONNX spec.

: Compute mul in numpy according to ONNX spec.

: Compute Negative in numpy according to ONNX spec.

: Compute not in numpy according to ONNX spec.

: Compute not in numpy according to ONNX spec and cast outputs to floats.

: Compute or in numpy according to ONNX spec.

: Compute or in numpy according to ONNX spec and cast outputs to floats.

: Compute pow in numpy according to ONNX spec.

: Compute relu in numpy according to ONNX spec.

: Compute round in numpy according to ONNX spec.

: Compute selu in numpy according to ONNX spec.

: Compute sigmoid in numpy according to ONNX spec.

: Compute Sign in numpy according to ONNX spec.

: Compute sin in numpy according to ONNX spec.

: Compute sinh in numpy according to ONNX spec.

: Compute softmax in numpy according to ONNX spec.

: Compute softplus in numpy according to ONNX spec.

: Compute sub in numpy according to ONNX spec.

: Compute tan in numpy according to ONNX spec.

: Compute tanh in numpy according to ONNX spec.

: Compute thresholdedrelu in numpy according to ONNX spec.

: Transpose in numpy according to ONNX spec.

: Compute the equivalent of numpy.where.

: Compute the equivalent of numpy.where.

: Decorate a numpy onnx function to flag the raw/non quantized inputs.

: Fill a parameter set structure from kwargs parameters.

: Convert the tree inference to a numpy functions using Hummingbird.

: Compile a Brevitas Quantization Aware Training model.

: Compile a torch module into an FHE equivalent.

: Compile a torch module into an FHE equivalent.

: Convert a torch tensor or a numpy array to a numpy array.

onnx_impl_utils.compute_conv_output_dims
onnx_impl_utils.compute_onnx_pool_padding
onnx_impl_utils.numpy_onnx_pad
onnx_impl_utils.onnx_avgpool_compute_norm_const
concrete.ml.onnx.onnx_impl_utils
check_inputs.check_X_y_and_assert
check_inputs.check_array_and_assert
concrete.ml.common.check_inputs
utils.generate_proxy_function
utils.get_onnx_opset_version
utils.replace_invalid_arg_name_chars
concrete.ml.common.utils
concrete.ml.common
concrete.ml.deployment
custom_assert.assert_false
custom_assert.assert_not_reached
custom_assert.assert_true
concrete.ml.common.debugging.custom_assert
fhe_client_server.FHEModelClient
fhe_client_server.FHEModelDev
fhe_client_server.FHEModelServer
concrete.ml.deployment.fhe_client_server
concrete.ml.onnx
onnx_utils.execute_onnx_with_numpy
onnx_utils.get_attribute
onnx_utils.get_op_name
concrete.ml.onnx.onnx_utils
convert.get_equivalent_numpy_forward
convert.get_equivalent_numpy_forward_and_onnx_model
onnx_model_manipulations.clean_graph_after_node_name
onnx_model_manipulations.clean_graph_after_node_op_type
onnx_model_manipulations.keep_following_outputs_discard_others
onnx_model_manipulations.remove_identity_nodes
onnx_model_manipulations.remove_node_types
onnx_model_manipulations.remove_unused_constant_nodes
onnx_model_manipulations.simplify_onnx_model
concrete.ml.onnx.convert
concrete.ml.onnx.onnx_model_manipulations
concrete.ml.quantization
base_quantized_op.QuantizedOp
base_quantized_op.QuantizedOpUnivariateOfEncrypted
concrete.ml.quantization.base_quantized_op
concrete.ml.common.debugging
post_training.ONNXConverter
post_training.PostTrainingAffineQuantization
post_training.PostTrainingQATImporter
concrete.ml.quantization.post_training
ops_impl.ONNXMixedFunction
ops_impl.cast_to_float
ops_impl.numpy_abs
ops_impl.numpy_acos
ops_impl.numpy_acosh
ops_impl.numpy_add
ops_impl.numpy_asin
ops_impl.numpy_asinh
ops_impl.numpy_atan
ops_impl.numpy_atanh
ops_impl.numpy_avgpool
ops_impl.numpy_batchnorm
ops_impl.numpy_cast
ops_impl.numpy_celu
ops_impl.numpy_constant
ops_impl.numpy_cos
ops_impl.numpy_cosh
ops_impl.numpy_div
ops_impl.numpy_elu
ops_impl.numpy_equal
ops_impl.numpy_erf
ops_impl.numpy_exp
ops_impl.numpy_flatten
ops_impl.numpy_floor
ops_impl.numpy_greater
ops_impl.numpy_greater_float
ops_impl.numpy_greater_or_equal
ops_impl.numpy_greater_or_equal_float
ops_impl.numpy_hardsigmoid
ops_impl.numpy_hardswish
ops_impl.numpy_identity
ops_impl.numpy_leakyrelu
ops_impl.numpy_less
ops_impl.numpy_less_float
ops_impl.numpy_less_or_equal
ops_impl.numpy_less_or_equal_float
ops_impl.numpy_log
ops_impl.numpy_matmul
ops_impl.numpy_max
ops_impl.numpy_min
ops_impl.numpy_mul
ops_impl.numpy_neg
ops_impl.numpy_not
ops_impl.numpy_not_float
ops_impl.numpy_or
ops_impl.numpy_or_float
ops_impl.numpy_pow
ops_impl.numpy_relu
ops_impl.numpy_round
ops_impl.numpy_selu
ops_impl.numpy_sigmoid
ops_impl.numpy_sign
ops_impl.numpy_sin
ops_impl.numpy_sinh
ops_impl.numpy_softmax
ops_impl.numpy_softplus
ops_impl.numpy_sub
ops_impl.numpy_tan
ops_impl.numpy_tanh
ops_impl.numpy_thresholdedrelu
ops_impl.numpy_transpose
ops_impl.numpy_where
ops_impl.numpy_where_body
ops_impl.onnx_func_raw_args
concrete.ml.onnx.ops_impl
concrete.ml.sklearn
quantized_module.QuantizedModule
glm.GammaRegressor
glm.PoissonRegressor
glm.TweedieRegressor
concrete.ml.quantization.quantized_module
concrete.ml.sklearn.glm
base.BaseTreeClassifierMixin
base.BaseTreeEstimatorMixin
base.BaseTreeRegressorMixin
base.QuantizedTorchEstimatorMixin
base.SklearnLinearClassifierMixin
base.SklearnLinearModelMixin
concrete.ml.sklearn.base
concrete.ml.sklearn.torch_module
protocols.ConcreteBaseClassifierProtocol
protocols.ConcreteBaseEstimatorProtocol
protocols.ConcreteBaseRegressorProtocol
protocols.Quantizer
linear_model.ElasticNet
linear_model.Lasso
linear_model.LinearRegression
linear_model.LogisticRegression
linear_model.Ridge
concrete.ml.sklearn.protocols
concrete.ml.sklearn.linear_model
quantizers.MinMaxQuantizationStats
quantizers.QuantizationOptions
quantizers.QuantizedArray
quantizers.UniformQuantizationParameters
quantizers.UniformQuantizer
quantizers.fill_from_kwargs
rf.RandomForestClassifier
rf.RandomForestRegressor
svm.LinearSVC
svm.LinearSVR
tree_to_numpy.Task
tree_to_numpy.tree_to_numpy
tree.DecisionTreeClassifier
tree.DecisionTreeRegressor
qnn.FixedTypeSkorchNeuralNet
qnn.NeuralNetClassifier
qnn.NeuralNetRegressor
qnn.QuantizedSkorchEstimatorMixin
qnn.SparseQuantNeuralNetImpl
concrete.ml.quantization.quantizers
concrete.ml.sklearn.rf
concrete.ml.sklearn.svm
concrete.ml.sklearn.tree_to_numpy
concrete.ml.sklearn.tree
concrete.ml.sklearn.qnn
xgb.XGBClassifier
xgb.XGBRegressor
concrete.ml.sklearn.xgb
concrete.ml.torch
concrete.ml.version
numpy_module.NumpyModule
compile.compile_brevitas_qat_model
compile.compile_onnx_model
compile.compile_torch_model
compile.convert_torch_tensor_or_numpy_array_to_numpy_array
concrete.ml.torch.numpy_module
concrete.ml.torch.compile
concrete.ml.quantization.quantized_ops
quantized_ops.QuantizedAbs
quantized_ops.QuantizedAdd
quantized_ops.QuantizedAvgPool
quantized_ops.QuantizedBatchNormalization
quantized_ops.QuantizedBrevitasQuant
quantized_ops.QuantizedCast
quantized_ops.QuantizedCelu
quantized_ops.QuantizedClip
quantized_ops.QuantizedConv
quantized_ops.QuantizedDiv
quantized_ops.QuantizedElu
quantized_ops.QuantizedErf
quantized_ops.QuantizedExp
quantized_ops.QuantizedFlatten
quantized_ops.QuantizedFloor
quantized_ops.QuantizedGemm
quantized_ops.QuantizedGreater
quantized_ops.QuantizedGreaterOrEqual
quantized_ops.QuantizedHardSigmoid
quantized_ops.QuantizedHardSwish
quantized_ops.QuantizedIdentity
quantized_ops.QuantizedLeakyRelu
quantized_ops.QuantizedLess
quantized_ops.QuantizedLessOrEqual
quantized_ops.QuantizedLog
quantized_ops.QuantizedMatMul
quantized_ops.QuantizedMax
quantized_ops.QuantizedMin
quantized_ops.QuantizedMul
quantized_ops.QuantizedNeg
quantized_ops.QuantizedNot
quantized_ops.QuantizedOr
quantized_ops.QuantizedPRelu
quantized_ops.QuantizedPad
quantized_ops.QuantizedPow
quantized_ops.QuantizedReduceSum
quantized_ops.QuantizedRelu
quantized_ops.QuantizedReshape
quantized_ops.QuantizedRound
quantized_ops.QuantizedSelu
quantized_ops.QuantizedSigmoid
quantized_ops.QuantizedSign
quantized_ops.QuantizedSoftplus
quantized_ops.QuantizedSub
quantized_ops.QuantizedTanh
quantized_ops.QuantizedTranspose
quantized_ops.QuantizedWhere