27 #include "Eigen/Dense" 29 #include "modules/prediction/proto/network_layers.pb.h" 36 namespace prediction {
49 float tanh(
const float x);
55 float linear(
const float x);
71 float relu(
const float x);
93 bool LoadTensor(
const TensorParameter& tensor_pb, Eigen::MatrixXf* matrix);
101 bool LoadTensor(
const TensorParameter& tensor_pb, Eigen::VectorXf* vector);
109 bool LoadTensor(
const TensorParameter& tensor_pb,
110 std::vector<Eigen::MatrixXf>*
const tensor3d);
float relu(const float x)
relu function: | 0.0 x in (-oo, 0.0) f(x) = | | x x in [0.0, +oo)
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
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)
float sigmoid(const float x)
sigmoid function: f(x) = 1 / (1 + exp(-x))
bool LoadTensor(const TensorParameter &tensor_pb, Eigen::MatrixXf *matrix)
load matrix value from a protobuf message
std::function< float(float)> serialize_to_function(const std::string &str)
translate a string into a network activation function
float linear(const float x)
linear function: f(x) = x
float tanh(const float x)
hyperbolic tangent function: f(x) = (1 + exp(-2x)) / (1 - exp(-2x))
Eigen::MatrixXf FlattenMatrix(const Eigen::MatrixXf &matrix)
flatten a matrix to a row vector