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

the input layer for a network, which specified the shape of input matrix 更多...

#include <net_layer.h>

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

Public 成员函数

bool Load (const apollo::prediction::LayerParameter &layer_pb) override
 Load the layer parameter from a pb message
 
void Run (const std::vector< Eigen::MatrixXf > &inputs, Eigen::MatrixXf *output) override
 Compute the layer output from inputs
 
- Public 成员函数 继承自 apollo::prediction::network::Layer
 Layer ()=default
 Constructor
 
virtual ~Layer ()=default
 Destructor
 
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
 
std::string Name () const
 Name of a layer
 
int OrderNumber () const
 Order number of a layer in a network
 

详细描述

the input layer for a network, which specified the shape of input matrix

在文件 net_layer.h417 行定义.

成员函数说明

◆ Load()

bool apollo::prediction::network::Input::Load ( const apollo::prediction::LayerParameter &  layer_pb)
overridevirtual

Load the layer parameter from a pb message

参数
Apb message contains the parameters
返回
True is loaded successively, otherwise False

重载 apollo::prediction::network::Layer .

在文件 net_layer.cc504 行定义.

504 {
505 if (!Layer::Load(layer_pb)) {
506 AERROR << "Fail to Load the layer parameters!";
507 return false;
508 }
509 InputParameter input_pb = layer_pb.input();
510 if (input_pb.input_shape_size() < 1) {
511 AERROR << "Fail to Load input shape of InputLayer!";
512 return false;
513 } else {
514 input_shape_.resize(input_pb.input_shape_size());
515 for (int i = 0; i < input_pb.input_shape_size(); ++i) {
516 input_shape_[i] = input_pb.input_shape(i);
517 }
518 }
519 if (!input_pb.has_dtype()) {
520 ADEBUG << "Set the type of input as float!";
521 dtype_ = "float32";
522 } else {
523 dtype_ = input_pb.dtype();
524 }
525 if (!input_pb.has_sparse()) {
526 ADEBUG << "set the sparse of input as false!";
527 sparse_ = false;
528 } else {
529 sparse_ = input_pb.sparse();
530 }
531 return true;
532}
virtual bool Load(const apollo::prediction::LayerParameter &layer_pb)
Load layer parameters from a protobuf message
Definition net_layer.cc:32
#define ADEBUG
Definition log.h:41
#define AERROR
Definition log.h:44
repeated int32 input_shape
optional string dtype
optional bool sparse

◆ Run()

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

Compute the layer output from inputs

参数
Inputsto a network layer
Outputof a network layer will be returned

实现了 apollo::prediction::network::Layer.

在文件 net_layer.cc534 行定义.

535 {
536 CHECK_EQ(inputs.size(), 1U);
537 CHECK_EQ(inputs[0].cols(), input_shape_.back());
538 *output = inputs[0];
539}

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