Skip to main content

SimaArgMax.h File

SimaArgMax Node — postprocess argmax over a tensor (classification). More...

Included Headers

#include "builder/Node.h" #include "builder/OutputSpec.h" #include <memory> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

structSimaArgMaxOptions

Construction options for a SimaArgMax Node. More...

classSimaArgMax

EV74 postprocess Node that emits the top-class index from a classification tensor. More...

Description

SimaArgMax Node — postprocess argmax over a tensor (classification).

Runs on the EV74. Reads a classification tensor (after dequant/cast) and emits the top class index per sample. Place after Detess/DetessDequant/DetessCast at the tail of a classification pipeline.

File Listing

The file content with the documentation metadata removed is:

1
10#pragma once
11
12#include "builder/Node.h"
13#include "builder/OutputSpec.h"
14
15#include <memory>
16#include <string>
17#include <vector>
18
19namespace simaai::neat {
20
27 std::string config_path;
29 bool silent = true;
30 bool emit_signals = false;
31 bool transmit = false;
32};
33
39class SimaArgMax final : public Node, public OutputSpecProvider {
40public:
42 explicit SimaArgMax(SimaArgMaxOptions opt = {});
43
45 std::string kind() const override {
46 return "SimaArgMax";
47 }
49 NodeCapsBehavior caps_behavior() const override {
50 return NodeCapsBehavior::Static;
51 }
53 bool has_config_json() const override;
55 bool wire_input_names(const std::vector<std::string>& upstream_names,
56 const std::string& tag) override;
58 std::string backend_fragment(int node_index) const override;
60 std::vector<std::string> element_names(int node_index) const override;
62 OutputSpec output_spec(const OutputSpec& input) const override;
63
65 const SimaArgMaxOptions& options() const {
66 return opt_;
67 }
68
69private:
70 struct ConfigHolder;
71
73 std::shared_ptr<ConfigHolder> config_holder_;
74 std::string config_path_;
75};
76
77} // namespace simaai::neat
78
79namespace simaai::neat::nodes {
81std::shared_ptr<simaai::neat::Node> SimaArgMax(SimaArgMaxOptions opt = {});
82} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.