27 #ifndef LBANN_LAYERS_ACTIVATIONS_ELU_HPP_INCLUDED 28 #define LBANN_LAYERS_ACTIVATIONS_ELU_HPP_INCLUDED 33 #include "lbann/proto/layers.pb.h" 52 template <
typename TensorDataType, data_layout Layout, El::Device Device>
61 std::string
get_type()
const override {
return "ELU"; }
80 template <
typename ArchiveT>
102 template <
typename T, data_layout L, El::Device D>
105 proto.set_datatype(proto::ProtoDataType<T>);
106 auto* msg = proto.mutable_elu();
110 #ifndef LBANN_ELU_LAYER_INSTANTIATE 111 #define PROTO_DEVICE(T, Device) \ 112 extern template class elu_layer<T, data_layout::DATA_PARALLEL, Device>; \ 113 extern template class elu_layer<T, data_layout::MODEL_PARALLEL, Device> 117 #endif // LBANN_ELU_LAYER_INSTANTIATE 121 #endif // LBANN_LAYERS_ACTIVATIONS_ELU_HPP_INCLUDED virtual void setup_dims()
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.
std::string get_type() const override
Get the layer type's name.
void bp_compute() override
Compute objective funciton gradients. Called by the 'back_prop' function. Given the input...
std::vector< int > get_input_dims(size_t input_index=0) const
Get input tensor dimensions.
Generates nicely formatted description messages.
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
virtual description get_description() const
Human-readable description.
constexpr El::Device Device
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.
elu_layer(lbann_comm *comm, TensorDataType alpha=El::To< TensorDataType >(1))
void set_output_dims(std::vector< int > dims, size_t output_index=0)
Set output tensor dimensions.
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.
data_layout
Data layout that is optimized for different modes of parallelism.
void write_specific_proto(lbann_data::Layer &proto) const final
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
description get_description() const override
Human-readable description.
void serialize(ArchiveT &ar)
elu_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...