Apollo  6.0
Open source self driving car software
Public Member Functions | Protected Attributes | List of all members
apollo::prediction::network::NetModel Class Referenceabstract

NetModel is a base class for specific network model It contains a pure virtual function Run which must be implemented in derived class. More...

#include <net_model.h>

Inheritance diagram for apollo::prediction::network::NetModel:
Inheritance graph
Collaboration diagram for apollo::prediction::network::NetModel:
Collaboration graph

Public Member Functions

 NetModel ()=default
 Constructor. More...
 
virtual ~NetModel ()=default
 Destructor. More...
 
virtual void Run (const std::vector< Eigen::MatrixXf > &inputs, Eigen::MatrixXf *output) const =0
 Compute the model output from inputs. More...
 
virtual void SetState (const std::vector< Eigen::MatrixXf > &states)
 Set the internal state of a network model. More...
 
virtual void State (std::vector< Eigen::MatrixXf > *states) const
 Access to the internal state of a network model. More...
 
virtual void ResetState () const
 Set the internal state of a model. More...
 
bool LoadModel (const NetParameter &net_parameter)
 Load network parameters from a protobuf message. More...
 
std::string PerformanceString () const
 Shows the performance information of a network. More...
 
const std::string & Name () const
 Name of a network model. More...
 
int Id () const
 Id of a network model. More...
 
bool IsOk () const
 Indicate the state of a network model. More...
 

Protected Attributes

std::vector< std::unique_ptr< Layer > > layers_
 
NetParameter net_parameter_
 
bool ok_ = false
 

Detailed Description

NetModel is a base class for specific network model It contains a pure virtual function Run which must be implemented in derived class.

Constructor & Destructor Documentation

◆ NetModel()

apollo::prediction::network::NetModel::NetModel ( )
default

Constructor.

◆ ~NetModel()

virtual apollo::prediction::network::NetModel::~NetModel ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Id()

int apollo::prediction::network::NetModel::Id ( ) const

Id of a network model.

Returns
Id of a network model

◆ IsOk()

bool apollo::prediction::network::NetModel::IsOk ( ) const

Indicate the state of a network model.

Returns
True of a network model is load successively, otherwise False.

◆ LoadModel()

bool apollo::prediction::network::NetModel::LoadModel ( const NetParameter &  net_parameter)

Load network parameters from a protobuf message.

Parameters
NetParameteris a protobuf message
Returns
True if successfully loaded, otherwise False

◆ Name()

const std::string& apollo::prediction::network::NetModel::Name ( ) const

Name of a network model.

Returns
Name of a network model

◆ PerformanceString()

std::string apollo::prediction::network::NetModel::PerformanceString ( ) const

Shows the performance information of a network.

Returns
Performance of a network model

◆ ResetState()

virtual void apollo::prediction::network::NetModel::ResetState ( ) const
inlinevirtual

Set the internal state of a model.

Parameters
Aspecified internal state in a vector of Eigen::MatrixXf

Reimplemented in apollo::prediction::network::RnnModel.

◆ Run()

virtual void apollo::prediction::network::NetModel::Run ( const std::vector< Eigen::MatrixXf > &  inputs,
Eigen::MatrixXf *  output 
) const
pure virtual

Compute the model output from inputs.

Parameters
Inputsto a network
Outputof a network will be returned

Implemented in apollo::prediction::network::RnnModel, and apollo::planning::AutotuningMLPModel.

◆ SetState()

virtual void apollo::prediction::network::NetModel::SetState ( const std::vector< Eigen::MatrixXf > &  states)
inlinevirtual

Set the internal state of a network model.

Parameters
Aspecified internal state in a vector of Eigen::MatrixXf

Reimplemented in apollo::prediction::network::RnnModel.

◆ State()

virtual void apollo::prediction::network::NetModel::State ( std::vector< Eigen::MatrixXf > *  states) const
inlinevirtual

Access to the internal state of a network model.

Returns
Internal state in a vector of Eigen::MatrixXf of the model

Reimplemented in apollo::prediction::network::RnnModel.

Member Data Documentation

◆ layers_

std::vector<std::unique_ptr<Layer> > apollo::prediction::network::NetModel::layers_
protected

◆ net_parameter_

NetParameter apollo::prediction::network::NetModel::net_parameter_
protected

◆ ok_

bool apollo::prediction::network::NetModel::ok_ = false
protected

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