ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
lwtDev::MaxoutLayer Class Reference

#include <Stack.h>

Inheritance diagram for lwtDev::MaxoutLayer:
Collaboration diagram for lwtDev::MaxoutLayer:

Public Types

typedef std::pair< MatrixXd, VectorXd > InitUnit
 

Public Member Functions

 MaxoutLayer (const std::vector< InitUnit > &maxout_tensor)
 
virtual VectorXd compute (const VectorXd &) const override
 

Private Attributes

std::vector< MatrixXd > m_matrices
 
MatrixXd m_bias
 

Detailed Description

Definition at line 125 of file Stack.h.

Member Typedef Documentation

◆ InitUnit

typedef std::pair<MatrixXd, VectorXd> lwtDev::MaxoutLayer::InitUnit

Definition at line 128 of file Stack.h.

Constructor & Destructor Documentation

◆ MaxoutLayer()

lwtDev::MaxoutLayer::MaxoutLayer ( const std::vector< InitUnit > &  maxout_tensor)

Definition at line 217 of file Stack.cxx.

217  :
218  m_bias(units.size(), units.front().first.rows())
219  {
220  int out_pos = 0;
221  for (const auto& unit: units) {
222  m_matrices.push_back(unit.first);
223  m_bias.row(out_pos) = unit.second;
224  out_pos++;
225  }
226  }

Member Function Documentation

◆ compute()

VectorXd lwtDev::MaxoutLayer::compute ( const VectorXd &  in) const
overridevirtual

Implements lwtDev::ILayer.

Definition at line 227 of file Stack.cxx.

227  {
228  // eigen supports tensors, but only in the experimental component
229  // for now just stick to matrix and vector classes
230  const size_t n_mat = m_matrices.size();
231  const size_t out_dim = m_matrices.front().rows();
232  MatrixXd outputs(n_mat, out_dim);
233  for (size_t mat_n = 0; mat_n < n_mat; mat_n++) {
234  outputs.row(mat_n) = m_matrices.at(mat_n) * in;
235  }
236  outputs += m_bias;
237  return outputs.colwise().maxCoeff();
238  }

Member Data Documentation

◆ m_bias

MatrixXd lwtDev::MaxoutLayer::m_bias
private

Definition at line 133 of file Stack.h.

◆ m_matrices

std::vector<MatrixXd> lwtDev::MaxoutLayer::m_matrices
private

Definition at line 132 of file Stack.h.


The documentation for this class was generated from the following files:
python.CreateTierZeroArgdict.outputs
outputs
Definition: CreateTierZeroArgdict.py:189
lwtDev::MaxoutLayer::m_matrices
std::vector< MatrixXd > m_matrices
Definition: Stack.h:132
lwtDev::MaxoutLayer::m_bias
MatrixXd m_bias
Definition: Stack.h:133
perfmonmt-refit.units
string units
Definition: perfmonmt-refit.py:77
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21