package caisar-ir

  1. Overview
  2. Docs

This module defines the structure and interfaces for a Neural IntermediatE Representation (NIER).

It is primarly designed as an intermediate state into producing verifiable terms from an ONNX model.

Tensor module

Tensors are multidimensional arrays used to represent numerical such as a neural network weight

module Tensor : sig ... end

Modules for graph generation

module Node : sig ... end
module type VInput = sig ... end
module MakeVertex (I : VInput) : sig ... end
module Edge : sig ... end

NIER is a graph (V,E) where V is the set of vertices (nodes) and E is the set of edges (connections between nodes). Nodes contains the following informations:

  • unique id
  • name coming from the original model, if it exists
  • shape of the tensor resulting from the application of the node operation, if it exist
  • operation performed
  • parameters of the operation
  • an optional tensor storing the data

Note that tensor have their own shape; they must be equal to the NIER's node shape however.

module NierCFG (I : VInput) : sig ... end
module NierCFGFloat : sig ... end

Pretty printers

val print_cfg_graph : NierCFGFloat.t -> Base.unit
val out_cfg_graph : NierCFGFloat.t -> Base.unit
OCaml

Innovation. Community. Security.