Apollo 11.0
自动驾驶开放平台
apollo::prediction::network::Layer类 参考abstract

Layer is a base class for specific network layers It contains a pure virtual function Run which must be implemented in derived class 更多...

#include <net_layer.h>

类 apollo::prediction::network::Layer 继承关系图:
apollo::prediction::network::Layer 的协作图:

Public 成员函数

 Layer ()=default
 Constructor
 
virtual ~Layer ()=default
 Destructor
 
virtual bool Load (const apollo::prediction::LayerParameter &layer_pb)
 Load layer parameters from a protobuf message
 
virtual void ResetState ()
 Reset the internal state of a layer such as LSTM, GRU
 
virtual void SetState (const std::vector< Eigen::MatrixXf > &states)
 Set the internal state of a layer
 
virtual void State (std::vector< Eigen::MatrixXf > *states) const
 Access to the internal state of a layer
 
virtual void Run (const std::vector< Eigen::MatrixXf > &inputs, Eigen::MatrixXf *output)=0
 Compute the layer output from inputs
 
std::string Name () const
 Name of a layer
 
int OrderNumber () const
 Order number of a layer in a network
 

详细描述

Layer is a base class for specific network layers It contains a pure virtual function Run which must be implemented in derived class

在文件 net_layer.h38 行定义.

构造及析构函数说明

◆ Layer()

apollo::prediction::network::Layer::Layer ( )
default

Constructor

◆ ~Layer()

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

Destructor

成员函数说明

◆ Load()

bool Layer::Load ( const apollo::prediction::LayerParameter &  layer_pb)
virtual

Load layer parameters from a protobuf message

参数
LayerParameteris a protobuf message
返回
True if successly loaded, otherwise False

apollo::prediction::network::Dense, apollo::prediction::network::Conv1d, apollo::prediction::network::MaxPool1d, apollo::prediction::network::AvgPool1d, apollo::prediction::network::Activation, apollo::prediction::network::BatchNormalization, apollo::prediction::network::LSTM, apollo::prediction::network::Flatten, apollo::prediction::network::Input , 以及 apollo::prediction::network::Concatenate 重载.

在文件 net_layer.cc32 行定义.

32 {
33 if (!layer_pb.has_name()) {
34 ADEBUG << "Set name at default";
35 name_ = "layer";
36 } else {
37 name_ = layer_pb.name();
38 }
39 if (!layer_pb.has_order_number()) {
40 ADEBUG << "Set order number at default";
41 order_number_ = -1;
42 } else {
43 order_number_ = layer_pb.order_number();
44 }
45 return true;
46}
#define ADEBUG
Definition log.h:41

◆ Name()

std::string apollo::prediction::network::Layer::Name ( ) const
inline

Name of a layer

返回
Name of a layer

在文件 net_layer.h86 行定义.

86{ return name_; }

◆ OrderNumber()

int apollo::prediction::network::Layer::OrderNumber ( ) const
inline

Order number of a layer in a network

返回
Order numer of a layer in a network

在文件 net_layer.h92 行定义.

92{ return order_number_; }

◆ ResetState()

virtual void apollo::prediction::network::Layer::ResetState ( )
inlinevirtual

Reset the internal state of a layer such as LSTM, GRU

apollo::prediction::network::LSTM 重载.

在文件 net_layer.h60 行定义.

60{}

◆ Run()

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

◆ SetState()

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

Set the internal state of a layer

参数
Aspecified internal state in a vector of Eigen::MatrixXf

apollo::prediction::network::LSTM 重载.

在文件 net_layer.h66 行定义.

66{}

◆ State()

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

Access to the internal state of a layer

返回
Internal state in a vector of Eigen::MatrixXf

apollo::prediction::network::LSTM 重载.

在文件 net_layer.h72 行定义.

72{}

该类的文档由以下文件生成: