27 #ifndef LBANN_LAYERS_LEARNING_FULLY_CONNECTED_HPP_INCLUDED 28 #define LBANN_LAYERS_LEARNING_FULLY_CONNECTED_HPP_INCLUDED 55 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
78 bool has_bias =
true);
91 std::string
get_type()
const override {
return "fully connected"; }
100 #ifdef LBANN_HAS_ONNX 101 void fill_onnx_node(onnx::GraphProto& graph)
const override;
102 #endif // LBANN_HAS_ONNX 109 template <
typename ArchiveT>
121 void setup_data(
size_t max_mini_batch_size)
override;
144 if (m_bias_gradient !=
nullptr)
148 template <
typename U>
150 template <
typename U>
157 #ifndef LBANN_FULLY_CONNECTED_LAYER_INSTANTIATE 159 #define PROTO_DEVICE(T, Device) \ 160 extern template class fully_connected_layer<T, \ 161 data_layout::DATA_PARALLEL, \ 163 extern template class fully_connected_layer<T, \ 164 data_layout::MODEL_PARALLEL, \ 170 #endif // LBANN_FULLY_CONNECTED_LAYER_INSTANTIATE 174 #endif // LBANN_LAYERS_LEARNING_FULLY_CONNECTED_HPP_INCLUDED
friend void fp_compute_impl(fully_connected_layer< U, T_layout, Dev > &l)
TensorDataType m_bias_scaling_factor
std::map< El::Int, std::set< El::Int > > transpose(const std::set< El::Int > &nodes, const std::map< El::Int, std::set< El::Int >> &edges)
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
friend void bp_compute_impl(fully_connected_layer< U, T_layout, Dev > &l)
description get_description() const override
Human-readable description.
fully_connected_layer & operator=(const fully_connected_layer &other)
Generates nicely formatted description messages.
std::string get_type() const override
Get the layer type's name.
AbsDistMatrixType * m_bias_gradient
constexpr El::Device Device
void setup_data(size_t max_mini_batch_size) override
Setup layer data. Called by the 'setup' function. Memory is allocated for distributed matrices...
~fully_connected_layer() override
void deallocate_matrices()
void write_specific_proto(lbann_data::Layer &proto) const final
void serialize(ArchiveT &ar)
friend class cereal::access
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
void bp_compute() override
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
data_layout
Data layout that is optimized for different modes of parallelism.
El::AbstractDistMatrix< TensorDataType > AbsDistMatrixType
The tensor type expected in this object.
void fp_compute() override
Apply layer operation. Called by the 'forward_prop' function. Given the input tensors, the output tensors are populated with computed values.
fully_connected_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
LBANN_DEFINE_LAYER_BUILDER(elu)
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.