package caisar

  1. Overview
  2. Docs

Module to parse neural networks written in the NNet format https://github.com/sisl/NNet

type t = private {
  1. n_layers : int;
    (*

    Number of layers.

    *)
  2. n_inputs : int;
    (*

    Number of inputs.

    *)
  3. n_outputs : int;
    (*

    Number of outputs.

    *)
  4. max_layer_size : int;
    (*

    Maximum layer size.

    *)
  5. layer_sizes : int list;
    (*

    Size of each layer.

    *)
  6. min_input_values : float list option;
    (*

    Minimum values of inputs.

    *)
  7. max_input_values : float list option;
    (*

    Maximum values of inputs.

    *)
  8. mean_values : (float list * float) option;
    (*

    Mean values of inputs and one value for all outputs.

    *)
  9. range_values : (float list * float) option;
    (*

    Range values of inputs and one value for all outputs.

    *)
  10. weights_biases : float list list;
    (*

    All weights and biases of NNet model.

    *)
  11. nir : Nir.Ngraph.t;
}

NNet model metadata.

val parse : ?permissive:bool -> string -> (t, string) Result.t

Parse an NNet file.

  • parameter permissive

    false by default. When set, parsing does not fail on non available information, which are set to None instead.

val to_nir : t -> Nir.Ngraph.t

Convert an well-formed NNet into a Nir.

OCaml

Innovation. Community. Security.