MLCompilerBridge
Tools for streamlining communication with ML models for compiler optimizations.
Loading...
Searching...
No Matches
agent.h
Go to the documentation of this file.
1//=== MLModelRunner/ONNXModelRunner/agent.h - Agent Model Helper - C++ -===//
2//
3// Part of the MLCompilerBridge Project, under the Apache License v2.0 with LLVM
4// Exceptions. See the LICENSE file for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===---------------------------------------------------------------------===//
16//===----------------------------------------------------------------------===//
17
18#ifndef ONNX_MODELRUNNER_AGENT_H
19#define ONNX_MODELRUNNER_AGENT_H
20
23
24#include <stdio.h>
25#include <string>
26
27namespace MLBridge {
30class Agent {
32
33public:
34 Agent(std::string model_path);
36 unsigned computeAction(Observation &obs);
37};
38} // namespace MLBridge
39
40#endif // ONNX_MODELRUNNER_AGENT_H
Agent is a wrapper around the ONNXModel class, interfaces with the Environment class to support ML/RL...
Definition agent.h:30
ONNXModel * model
Definition agent.h:31
Agent(std::string model_path)
Definition agent.cpp:23
unsigned computeAction(Observation &obs)
Runs the ONNX model on the input Observation and returns the output.
Definition agent.cpp:28
llvm::SmallVector< float, 300 > Observation
Definition utils.h:15
This file defines the ONNXModel class, which is a wrapper around the ONNX C++ interface.