Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
dipla::Network Class Reference

Owns an ONNX session and samples eight metre-valued control points. More...

#include <dipla_planner.hpp>

Data Structures

struct  State
 Runtime-owned ONNX session and reusable input/output storage. More...

Public Member Functions

 Network (const std::string &model, const std::string &metadata, const NetworkOptions &options={})
 Load and validate a deployment model.
 ~Network ()
 Releases the owned ONNX session and inference buffers.
Waypoints sample (const Belief &belief, const std::array< double, 3 > &position, const Noise &noise)
 Run the complete deterministic DDIM sampler for a supplied noise vector.

Private Attributes

std::unique_ptr< State > state_

Detailed Description

Owns an ONNX session and samples eight metre-valued control points.

Construction validates metadata and tensors; serialize sampling on one instance.

Definition at line 159 of file dipla_planner.hpp.

Constructor & Destructor Documentation

◆ Network()

dipla::Network::Network ( const std::string & model,
const std::string & metadata,
const NetworkOptions & options = {} )

Load and validate a deployment model.

Construction performs the expensive one-time graph, metadata, input-name, element-type, and shape checks before the object can sample.

Parameters
modelPath to the ONNX model.
metadataPath to its bounded deployment JSON metadata.
optionsOptional descriptor and bounded ONNX execution policy.
Exceptions
std::exceptionIf files, metadata, runtime, or tensor contracts are invalid.

Build the entire private state before exposing a usable Network. The pimpl keeps runtime and tensor implementation types out of the public API.

Definition at line 465 of file dipla_planner.cpp.

◆ ~Network()

dipla::Network::~Network ( )
default

Releases the owned ONNX session and inference buffers.

Pimpl ownership ensures runtime objects are destroyed with the network.

Destroy State through its owner so the session closes before its buffers disappear.

Member Function Documentation

◆ sample()

Waypoints dipla::Network::sample ( const Belief & belief,
const std::array< double, 3 > & position,
const Noise & noise )

Run the complete deterministic DDIM sampler for a supplied noise vector.

Belief channels and position are normalized according to model metadata; the eight XYZ outputs are converted back to metres. The supplied noise is not mutated, so identical inputs produce identical waypoints.

Parameters
beliefPosterior mean and variance on the fixed world grid.
positionCurrent local east, north, and actual altitude in metres.
noiseInitial 24-value standard-normal sample, grouped as X/Y/Z.
Returns
Eight ordered XYZ waypoints in metres.
Exceptions
std::runtime_errorIf inputs are nonfinite/out of bounds or inference fails.
Precondition
One caller at a time owns this network; reusable tensors are mutable.
Note
Returned Z is part of the trained tensor contract. The fixed-height demo publishes only XY and must not substitute predicted Z for actual AGL.

This is the complete sampler, not one neural-network pass. Conditioning inputs stay fixed while twenty noise predictions reconstruct one route. The caller supplies initial noise so numerical tests can compare identical inputs without depending on C++ and NumPy generating identical random streams.

Precision matters
Match the reference's float32 graph boundary and double-precision DDIM arithmetic. Moving casts or simplifying apparently equivalent expressions can change the trajectory over twenty steps; check reference parity first.
Note
The deadline is cooperative and covers the whole plan. It is not a hard real-time guarantee or a fresh allowance for each network call.
See also
apply_flight_margin Application-owned XY padding, intentionally absent here.
Todo
Share XY and Z normalization bounds with metadata validation and output denormalization. These are training scales, not flight-height settings.
Todo
Derive these inverse transforms from the same supported-world contract as input normalization. Changing just one direction rescales routes.

Definition at line 486 of file dipla_planner.cpp.

Field Documentation

◆ state_

std::unique_ptr<State> dipla::Network::state_
private

Exclusive ownership keeps the runtime session lifetime tied to this object.

Definition at line 198 of file dipla_planner.hpp.


The documentation for this class was generated from the following files: