Loading...
Searching...
No Matches
onnx_export.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 Artificial Intelligence Techniques, S.L. and Roberto López González
3
4#pragma once
5
7
8namespace opennn
9{
10
11class Network;
12
13// A network written as an ONNX model (IR 7, opset 13), encoded directly so that
14// no onnx dependency is needed. The graph has one float input "input"
15// [batch, inputs] and one float output "output" [batch, outputs], and it
16// reproduces Network::calculate_outputs: scaling, dense layers, unscaling and
17// clamping are all part of it. The input and output feature names are stored as
18// the "input_names" and "output_names" metadata entries.
19
21{
22 string bytes;
23 vector<string> layers;
24 Index nodes_number = 0;
25};
26
27// Supports sequential networks of Scaling, Dense, Unscaling and Clamping layers
28// with FP32 parameters, and throws naming the first layer it cannot represent.
29OnnxModel build_onnx_model(const Network&, const vector<string>& class_names = {});
30
31void save_onnx_model(const Network&, const filesystem::path&, const vector<string>& class_names = {});
32
33}
Definition network.h:87
Definition configuration.h:10
void save_onnx_model(const Network &, const filesystem::path &, const vector< string > &class_names={})
OnnxModel build_onnx_model(const Network &, const vector< string > &class_names={})
Definition onnx_export.h:21
Index nodes_number
Definition onnx_export.h:24
string bytes
Definition onnx_export.h:22
vector< string > layers
Definition onnx_export.h:23