27 #ifndef LBANN_LAYERS_LEARNING_DECONVOLUTION_HPP_INCLUDED 28 #define LBANN_LAYERS_LEARNING_DECONVOLUTION_HPP_INCLUDED 35 #ifdef LBANN_HAS_DISTCONV 36 template <
typename TensorDataType, data_layout Layout, El::Device Device>
37 class deconvolution_distconv_adapter
38 :
public base_convolution_adapter<TensorDataType, Device>
42 typename base_convolution_adapter<TensorDataType, Device>::TensorDevType;
44 deconvolution_distconv_adapter(Layer& layer)
45 : base_convolution_adapter<TensorDataType,
Device>(layer)
47 virtual ~deconvolution_distconv_adapter() =
default;
49 void setup_distributions(tensor_overlap_constraints& constraints)
override;
50 void setup_layer(
size_t workspace_capacity)
override;
51 dc::Shape get_activations_local_shape(
int index = 0)
const override;
53 #endif // LBANN_HAS_DISTCONV 65 template <
typename TensorDataType, data_layout Layout, El::Device Device>
70 "deconvolution layer only supports DATA_PARALLEL");
74 int num_output_channels,
75 std::vector<int> conv_dims,
76 std::vector<int> pads,
77 std::vector<int> strides,
78 std::vector<int> dilations,
79 std::vector<int> output_pads,
88 std::string
get_type()
const override {
return "deconvolution"; }
101 void setup_dims()
override;
106 template <
typename ArchiveT>
113 void write_specific_proto(lbann_data::Layer& proto)
const final;
115 friend class cereal::access;
118 std::vector<int> get_kernel_dims()
const override;
119 void fp_compute()
override;
120 void bp_compute()
override;
122 #ifdef LBANN_HAS_DISTCONV 123 friend class deconvolution_distconv_adapter<TensorDataType, Layout,
Device>;
126 void setup_distconv_adapter()
override;
127 bool is_distconv_supported()
const override;
128 #endif // LBANN_HAS_DISTCONV 141 #ifndef LBANN_DECONVOLUTION_LAYER_INSTANTIATE 143 #define PROTO_DEVICE(T, Device) \ 144 extern template class deconvolution_layer<T, \ 145 data_layout::DATA_PARALLEL, \ 151 #endif // LBANN_DECONVOLUTION_LAYER_INSTANTIATE 155 #endif // LBANN_LAYERS_LEARNING_DECONVOLUTION_HPP_INCLUDED
std::vector< int > m_output_pads
Padding for output tensor.
data_layout get_data_layout() const override
Get data layout of the data tensors. We assume that the data layouts of the previous activations...
int get_backprop_requirements() const override
Returns the necessary tensors for computing backpropagation.
void serialize(std::ostream &os, google::protobuf::Message const &msg)
Serialize the protobuf message to a stream.
constexpr El::Device Device
::distconv::tensor::Shape Shape
std::string get_type() const override
Get the layer type's name.
El::Device get_device_allocation() const override
Get the device allocation for the data tensors. We assume that the decice allocation of the previous ...
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
data_layout
Data layout that is optimized for different modes of parallelism.
deconvolution_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
LBANN_DEFINE_LAYER_BUILDER(elu)
Computation kernels for convolution and deconvolution layers.