Skip to contents

A network trained elsewhere (PyTorch, Keras), run in double precision. It supports the operators a tabular network exports: Gemm, Linear, MatMul, broadcasting arithmetic, the common activations, Softmax, Concat, Gather embeddings, reshapes and reductions; anything else is refused at load, with the operators the file uses. Outputs agree with onnxruntime within float32 rounding.

Usage

onnx_model(file)

Arguments

file

A path to an .onnx file, or its bytes as a raw vector.

Value

An onnx_model with properties inputs (a data frame of each graph input's name, rank and integer, with its shape in the "shapes" attribute, NA where the file leaves a size free), outputs and ops. Use onnx_run(), or onnx_predictor() to predict from data frame columns.

Examples

f <- system.file("extdata", "mlp.onnx", package = "prospicio")
if (nzchar(f)) onnx_model(f)@ops