Apollo  6.0
Open source self driving car software
Classes | Functions
apollo::prediction::network Namespace Reference

apollo::prediction::network More...

Classes

class  Activation
 Activation is an activation network layer. Activation layer output is y = f(x), where x is the input, y the output and f the activation function. More...
 
class  AvgPool1d
 AvgPool1d is the average Pool 1d network layer. More...
 
class  BatchNormalization
 
class  Concatenate
 
class  Conv1d
 Conv1d is the convolution 1d network layer. Conv1d layer output is y = Conv(x, w), where x is the input, w the weight. More...
 
class  Dense
 Dense is the forward fully connected network layer. Dense layer output is y = f(x*w + b), where x is the input, w the weight, b the bias and f the activation. More...
 
class  Flatten
 
class  Input
 
class  Layer
 Layer is a base class for specific network layers It contains a pure virtual function Run which must be implemented in derived class. More...
 
class  LSTM
 For a step-by-step description of the algorithm, see this tutorial. More...
 
class  MaxPool1d
 MaxPool1d is the max Pool 1d network layer. More...
 
class  NetModel
 NetModel is a base class for specific network model It contains a pure virtual function Run which must be implemented in derived class. More...
 
class  RnnModel
 RnnModel is a derived class from NetModel, it has a specific layers structure. More...
 

Functions

float sigmoid (const float x)
 sigmoid function: f(x) = 1 / (1 + exp(-x)) More...
 
float tanh (const float x)
 hyperbolic tangent function: f(x) = (1 + exp(-2x)) / (1 - exp(-2x)) More...
 
float linear (const float x)
 linear function: f(x) = x More...
 
float hard_sigmoid (const float x)
 "hard" sigmoid function: | 0.0 x in (-oo, 0) f(x) = | 0.2x + 0.5 x in [0, 2.5] | 1.0 x in (2.5, +oo) More...
 
float relu (const float x)
 relu function: | 0.0 x in (-oo, 0.0) f(x) = | | x x in [0.0, +oo) More...
 
Eigen::MatrixXf FlattenMatrix (const Eigen::MatrixXf &matrix)
 flatten a matrix to a row vector More...
 
std::function< float(float)> serialize_to_function (const std::string &str)
 translate a string into a network activation function More...
 
bool LoadTensor (const TensorParameter &tensor_pb, Eigen::MatrixXf *matrix)
 load matrix value from a protobuf message More...
 
bool LoadTensor (const TensorParameter &tensor_pb, Eigen::VectorXf *vector)
 load vector value from a protobuf message More...
 
bool LoadTensor (const TensorParameter &tensor_pb, std::vector< Eigen::MatrixXf > *const tensor3d)
 load matrix value from a protobuf message More...
 

Detailed Description

apollo::prediction::network

Function Documentation

◆ FlattenMatrix()

Eigen::MatrixXf apollo::prediction::network::FlattenMatrix ( const Eigen::MatrixXf &  matrix)

flatten a matrix to a row vector

Parameters
Inputmatrix
Returns
Flattened matrix

◆ hard_sigmoid()

float apollo::prediction::network::hard_sigmoid ( const float  x)

"hard" sigmoid function: | 0.0 x in (-oo, 0) f(x) = | 0.2x + 0.5 x in [0, 2.5] | 1.0 x in (2.5, +oo)

◆ linear()

float apollo::prediction::network::linear ( const float  x)

linear function: f(x) = x

◆ LoadTensor() [1/3]

bool apollo::prediction::network::LoadTensor ( const TensorParameter &  tensor_pb,
Eigen::MatrixXf *  matrix 
)

load matrix value from a protobuf message

Parameters
protobufmessage in the form of TensorParameter
Eigen::MatrixXfwill be returned
Returns
True if load data successively, otherwise False

◆ LoadTensor() [2/3]

bool apollo::prediction::network::LoadTensor ( const TensorParameter &  tensor_pb,
Eigen::VectorXf *  vector 
)

load vector value from a protobuf message

Parameters
protobufmessage in the form of TensorParameter
Eigen::VectorXfwill be returned
Returns
True if load data successively, otherwise False

◆ LoadTensor() [3/3]

bool apollo::prediction::network::LoadTensor ( const TensorParameter &  tensor_pb,
std::vector< Eigen::MatrixXf > *const  tensor3d 
)

load matrix value from a protobuf message

Parameters
protobufmessage in the form of TensorParameter
vectorof Eigen::MatrixXf will be returned
Returns
True if load data successively, otherwise False

◆ relu()

float apollo::prediction::network::relu ( const float  x)

relu function: | 0.0 x in (-oo, 0.0) f(x) = | | x x in [0.0, +oo)

◆ serialize_to_function()

std::function<float(float)> apollo::prediction::network::serialize_to_function ( const std::string &  str)

translate a string into a network activation function

Parameters
string
Returns
activation function map to the string

◆ sigmoid()

float apollo::prediction::network::sigmoid ( const float  x)

sigmoid function: f(x) = 1 / (1 + exp(-x))

◆ tanh()

float apollo::prediction::network::tanh ( const float  x)

hyperbolic tangent function: f(x) = (1 + exp(-2x)) / (1 - exp(-2x))