24 #include "modules/prediction/proto/network_model.pb.h" 31 namespace prediction {
57 virtual void Run(
const std::vector<Eigen::MatrixXf>& inputs,
58 Eigen::MatrixXf* output)
const = 0;
64 virtual void SetState(
const std::vector<Eigen::MatrixXf>& states) {}
70 virtual void State(std::vector<Eigen::MatrixXf>* states)
const {}
83 bool LoadModel(
const NetParameter& net_parameter);
95 const std::string&
Name()
const;
std::vector< std::unique_ptr< Layer > > layers_
Definition: net_model.h:110
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
bool ok_
Definition: net_model.h:112
NetParameter net_parameter_
Definition: net_model.h:111
int Id() const
Id of a network model.
bool LoadModel(const NetParameter &net_parameter)
Load network parameters from a protobuf message.
virtual void SetState(const std::vector< Eigen::MatrixXf > &states)
Set the internal state of a network model.
Definition: net_model.h:64
std::string PerformanceString() const
Shows the performance information of a network.
const std::string & Name() const
Name of a network model.
bool IsOk() const
Indicate the state of a network model.
NetModel is a base class for specific network model It contains a pure virtual function Run which mus...
Definition: net_model.h:40
NetModel()=default
Constructor.
virtual void ResetState() const
Set the internal state of a model.
Definition: net_model.h:76
virtual void State(std::vector< Eigen::MatrixXf > *states) const
Access to the internal state of a network model.
Definition: net_model.h:70
virtual void Run(const std::vector< Eigen::MatrixXf > &inputs, Eigen::MatrixXf *output) const =0
Compute the model output from inputs.
virtual ~NetModel()=default
Destructor.