package caisar

  1. Overview
  2. Docs

Models

ModelProto is a top-level file/container format for bundling a ML model and associating its computation graph with metadata.

The semantics of the model are described by the associated GraphProto's.

type t = {
  1. ir_version : int64 option;
    (*

    The version of the IR this model targets. See Version enum above. This field MUST be present.

    *)
  2. producer_name : string option;
    (*

    The name of the framework or tool used to generate this model. This field SHOULD be present to indicate which implementation/tool/framework emitted the model.

    *)
  3. producer_version : string option;
    (*

    The version of the framework or tool used to generate this model. This field SHOULD be present to indicate which implementation/tool/framework emitted the model.

    *)
  4. domain : string option;
    (*

    Domain name of the model. We use reverse domain names as name space indicators. For example: `com.facebook.fair` or `com.microsoft.cognitiveservices`

    Together with `model_version` and GraphProto.name, this forms the unique identity of the graph.

    *)
  5. model_version : int64 option;
    (*

    The version of the graph encoded. See Version enum below.

    *)
  6. doc_string : string option;
    (*

    A human-readable documentation for this model. Markdown is allowed.

    *)
  7. graph : GraphProto.t option;
    (*

    The parameterized graph that is evaluated to execute the model.

    *)
  8. opset_import : OperatorSetIdProto.t list;
    (*

    The OperatorSets this model relies on. All ModelProtos MUST have at least one entry that specifies which version of the ONNX OperatorSet is being imported.

    All nodes in the ModelProto's graph will bind against the operator with the same-domain/same-op_type operator with the HIGHEST version in the referenced operator sets.

    *)
  9. metadata_props : StringStringEntryProto.t list;
    (*

    Named metadata values; keys should be distinct.

    *)
  10. training_info : TrainingInfoProto.t list;
    (*

    Training-specific information. Sequentially executing all stored `TrainingInfoProto.algorithm`s and assigning their outputs following the corresponding `TrainingInfoProto.update_binding`s is one training iteration. Similarly, to initialize the model (as if training hasn't happened), the user should sequentially execute all stored `TrainingInfoProto.initialization`s and assigns their outputs using `TrainingInfoProto.initialization_binding`s.

    If this field is empty, the training behavior of the model is undefined.

    *)
  11. functions : FunctionProto.t list;
    (*

    A list of function protos local to the model.

    Name of the function "FunctionProto.name" should be unique within the domain "FunctionProto.domain". In case of any conflicts the behavior (whether the model local functions are given higher priority, or standard opserator sets are given higher priotity or this is treated as error) is defined by the runtimes.

    The operator sets imported by FunctionProto should be compatible with the ones imported by ModelProto and other model local FunctionProtos. Example, if same operator set say 'A' is imported by a FunctionProto and ModelProto or by 2 FunctionProtos then versions for the operator set may be different but, the operator schema returned for op_type, domain, version combination for both the versions should be same for every node in the function body.

    One FunctionProto can reference other FunctionProto in the model, however, recursive reference is not allowed.

    *)
}
val make : ?ir_version:int64 -> ?producer_name:string -> ?producer_version:string -> ?domain:string -> ?model_version:int64 -> ?doc_string:string -> ?graph:GraphProto.t -> ?opset_import:OperatorSetIdProto.t list -> ?metadata_props:StringStringEntryProto.t list -> ?training_info:TrainingInfoProto.t list -> ?functions:FunctionProto.t list -> unit -> t

Helper function to generate a message using default values

Serialize the message to binary format

Deserialize from binary format

Serialize to Json (compatible with Yojson.Basic.t)

Deserialize from Json (compatible with Yojson.Basic.t)

val name : unit -> string

Fully qualified protobuf name of this message

OCaml

Innovation. Community. Security.