27 #ifndef LBANN_LAYERS_LOSS_L2_NORM2_IMPL_HPP_INCLUDED 28 #define LBANN_LAYERS_LOSS_L2_NORM2_IMPL_HPP_INCLUDED 35 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
41 m_workspace->AlignWith(this->get_prev_activations());
42 m_workspace->Resize(1, this->get_prev_activations().Width());
47 this->get_comm()->allreduce(*m_workspace, m_workspace->RedundantComm());
48 El::Copy(*m_workspace, this->get_activations());
54 template <
typename TensorDataType, data_layout T_layout, El::Device Dev>
60 m_workspace->AlignWith(this->get_prev_activations());
61 El::Copy(this->get_prev_error_signals(), *m_workspace);
70 template <
typename T, data_layout L, El::Device D>
72 lbann_data::Layer& proto)
const 74 proto.set_datatype(proto::ProtoDataType<T>);
75 proto.mutable_l2_norm2();
80 #endif // LBANN_LAYERS_LOSS_L2_NORM2_IMPL_HPP_INCLUDED
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.
void bp_compute() override
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
void write_specific_proto(lbann_data::Layer &proto) const final