A singular Riemannian geometry approach to Deep Neural Networks.
Public Member Functions | List of all members
fc_layer_sp Class Reference

Feedforward layer with softplus activation function. More...

#include <fc_layer_sp.h>

Public Member Functions

 fc_layer_sp ()
 
 fc_layer_sp (const std::vector< std::vector< double >> &weights_, const std::vector< double > &biases_)
 
 fc_layer_sp (const Eigen::MatrixXd &weights_, const Eigen::VectorXd &biases_)
 
 fc_layer_sp (const Eigen::MatrixXd &weights_, const std::vector< double > &biases_)
 
 ~fc_layer_sp ()
 
Eigen::VectorXd predict (const Eigen::VectorXd &input) override
 
std::vector< Eigen::VectorXd > predict_batch (const std::vector< Eigen::VectorXd > &input) override
 
Eigen::MatrixXd compute_partial_derivatives_wrt_inputs (Eigen::VectorXd &input)
 
Eigen::MatrixXd compute_partial_derivatives_wrt_weights_biases (Eigen::VectorXd &input)
 
- Public Member Functions inherited from layer
 layer ()
 
 layer (const std::vector< std::vector< double >> &weights_, const std::vector< double > &biases_)
 
 layer (const std::vector< std::vector< double >> &weights_)
 
 layer (const Eigen::MatrixXd &weights_)
 
 layer (const Eigen::MatrixXd &weights_, const std::vector< double > &biases_)
 
 layer (const Eigen::MatrixXd &weights_, const Eigen::VectorXd &biases_)
 
 layer (const Eigen::MatrixXd &weights_, const Eigen::VectorXd &biases_, int in_dim, int out_dim)
 
virtual ~layer ()
 
const Eigen::VectorXd get_biases ()
 
const Eigen::MatrixXd get_weights ()
 
const Eigen::MatrixXd get_weights_biases_as_mat ()
 
const Eigen::MatrixXd get_weights_biases_as_vec_col_maj ()
 
const Eigen::MatrixXd get_weights_biases_as_vec_row_maj ()
 
double get_weight (int i, int j)
 
double get_bias (int i)
 
void set_biases (const Eigen::VectorXd &biases_)
 
void set_biases (const std::vector< double > &biases_)
 
void set_weights (const Eigen::MatrixXd &weights_)
 
void set_weight (int i, int j, double weight_)
 
void set_bias (int i, double bias_)
 
void set_weights_biases_compact (Eigen::MatrixXd &source)
 
void set_weights_biases (Eigen::MatrixXd &source)
 
void set_weights_biases_row_maj (Eigen::MatrixXd &source)
 
int get_num_nodes ()
 
int get_input_size ()
 
int get_weights_rows ()
 
int get_weights_cols ()
 
std::string get_type ()
 
void transpose_weights ()
 
void set_exp_max_cut (double exp_max_cut_)
 
void set_exp_zero_approx (double exp_zero_approx_)
 
double get_exp_max_cut ()
 
double get_exp_zero_approx ()
 

Additional Inherited Members

- Protected Attributes inherited from layer
Eigen::VectorXd biases
 
Eigen::MatrixXd weights
 
int weights_rows = 0
 
int input_dim = 0
 
int output_dim = 0
 
int weights_cols = 0
 
std::string type
 
double exp_max_cut = 50.
 
double exp_zero_approx = 1.92874984e-22
 

Detailed Description

Feedforward layer with softplus activation function.

Constructor & Destructor Documentation

◆ fc_layer_sp() [1/4]

fc_layer_sp::fc_layer_sp ( )
inline

Default constructor.

◆ fc_layer_sp() [2/4]

fc_layer_sp::fc_layer_sp ( const std::vector< std::vector< double >> &  weights_,
const std::vector< double > &  biases_ 
)

Initializes a feedforward layer with softplus activation function given a matrix of weights and a vector of biases.

◆ fc_layer_sp() [3/4]

fc_layer_sp::fc_layer_sp ( const Eigen::MatrixXd &  weights_,
const Eigen::VectorXd &  biases_ 
)

Initializes a feedforward layer with softplus activation function given a matrix of weights and a vector of biases.

◆ fc_layer_sp() [4/4]

fc_layer_sp::fc_layer_sp ( const Eigen::MatrixXd &  weights_,
const std::vector< double > &  biases_ 
)

Initializes a feedforward layer with softplus activation function given a matrix of weights and a vector of biases.

◆ ~fc_layer_sp()

fc_layer_sp::~fc_layer_sp ( )
inline

Default deconstructor.

Member Function Documentation

◆ compute_partial_derivatives_wrt_inputs()

Eigen::MatrixXd fc_layer_sp::compute_partial_derivatives_wrt_inputs ( Eigen::VectorXd &  input)
virtual

Computes the Jacobian matrix with respect to the input variables. The Jacobian is computer in reduced form.

Implements layer.

◆ compute_partial_derivatives_wrt_weights_biases()

Eigen::MatrixXd fc_layer_sp::compute_partial_derivatives_wrt_weights_biases ( Eigen::VectorXd &  input)
virtual

Computes the Jacobian matrix with respect to weights and biases.

Implements layer.

◆ predict()

Eigen::VectorXd fc_layer_sp::predict ( const Eigen::VectorXd &  input)
overridevirtual

Computes the output of the layer given an Eigen::VectorXd as input.

Reimplemented from layer.

◆ predict_batch()

std::vector< Eigen::VectorXd > fc_layer_sp::predict_batch ( const std::vector< Eigen::VectorXd > &  input)
overridevirtual

Computes the outputs of the layer given a vector<Eigen::VectorXd> as input.

Reimplemented from layer.


The documentation for this class was generated from the following files: