29#include "modules/prediction/proto/network_layers.pb.h"
49float tanh(
const float x);
55float linear(
const float x);
71float relu(
const float x);
110 std::vector<Eigen::MatrixXf>*
const tensor3d);
float linear(const float x)
linear function: f(x) = x
std::function< float(float)> serialize_to_function(const std::string &str)
translate a string into a network activation function
float tanh(const float x)
hyperbolic tangent function: f(x) = (1 + exp(-2x)) / (1 - exp(-2x))
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....
Eigen::MatrixXf FlattenMatrix(const Eigen::MatrixXf &matrix)
flatten a matrix to a row vector
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
float relu(const float x)
relu function: | 0.0 x in (-oo, 0.0) f(x) = | | x x in [0.0, +oo)