27 #ifndef LBANN_LAYERS_LOSS_MEAN_ABSOLUTE_ERROR_HPP_INCLUDED 28 #define LBANN_LAYERS_LOSS_MEAN_ABSOLUTE_ERROR_HPP_INCLUDED 32 #include "lbann/proto/layers.pb.h" 44 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
84 template <
typename ArchiveT>
89 std::string
get_type()
const override {
return "mean absolute error"; }
100 void setup_data(
size_t max_mini_batch_size)
override;
123 template <
typename T, data_layout L, El::Device D>
125 lbann_data::Layer& proto)
const 127 proto.set_datatype(proto::ProtoDataType<T>);
128 proto.mutable_mean_absolute_error();
131 #ifndef LBANN_MEAN_ABSOLUTE_ERROR_LAYER_INSTANTIATE 133 #define PROTO_DEVICE(T, Device) \ 134 extern template class mean_absolute_error_layer<T, \ 135 data_layout::DATA_PARALLEL, \ 137 extern template class mean_absolute_error_layer<T, \ 138 data_layout::MODEL_PARALLEL, \ 144 #endif // LBANN_MEAN_ABSOLUTE_ERROR_LAYER_INSTANTIATE 148 #endif // LBANN_LAYERS_LOSS_MEAN_ABSOLUTE_ERROR_HPP_INCLUDED 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 write_specific_proto(lbann_data::Layer &proto) const final
void setup_data(size_t max_mini_batch_size) override
Setup layer data. Called by the 'setup' function. Memory is allocated for distributed matrices...
std::unique_ptr< AbsDistMatrixType > m_workspace
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
mean_absolute_error_layer & operator=(const mean_absolute_error_layer &other)
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
constexpr El::Device Device
void bp_compute() override
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
El::AbstractDistMatrix< TensorDataType > AbsDistMatrixType
The tensor type expected in this object.
mean_absolute_error_layer(const mean_absolute_error_layer &other)
mean_absolute_error_layer()
friend class cereal::access
void serialize(ArchiveT &ar)
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.
data_layout
Data layout that is optimized for different modes of parallelism.
std::string get_type() const override
Get the layer type's name.
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
void setup_dims() override
Setup tensor dimensions Called by the 'setup' function. If there are any input tensors, the base method sets all uninitialized output tensor dimensions equal to the first input tensor dimensions.
mean_absolute_error_layer(lbann_comm *comm)
mean_absolute_error_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
int m_expected_num_parent_layers
data_type_layer & operator=(data_type_layer &&other)=default