27 #ifndef LBANN_LAYER_BERNOULLI_HPP_INCLUDED 28 #define LBANN_LAYER_BERNOULLI_HPP_INCLUDED 41 template <
typename TensorDataType,
51 std::vector<int> dims,
63 template <
typename ArchiveT>
68 std::string
get_type()
const override {
return "Bernoulli"; }
77 desc.add(
"Probability",
m_prob);
95 #ifndef LBANN_BERNOULLI_LAYER_INSTANTIATE 97 #define PROTO_DEVICE(T, Device) \ 98 extern template class bernoulli_layer<T, \ 99 data_layout::DATA_PARALLEL, \ 101 extern template class bernoulli_layer<T, data_layout::MODEL_PARALLEL, Device> 106 #endif // LBANN_BERNOULLI_LAYER_INSTANTIATE 110 #endif // LBANN_LAYER_BERNOULLI_HPP_INCLUDED
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.
Generates nicely formatted description messages.
virtual description get_description() const
Human-readable description.
constexpr El::Device Device
void write_specific_proto(lbann_data::Layer &proto) const final
bernoulli_layer * copy() const override
Copy function. This function dynamically allocates memory for a layer instance and instantiates a cop...
void set_output_dims(std::vector< int > dims, size_t output_index=0)
Set output tensor dimensions.
Random tensor with Bernoulli distribution.
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 class cereal::access
void serialize(ArchiveT &ar)
bool can_run_inplace() const override
If True, the computation can run in-place (feeding each input activations tensor as the corresponding...
bernoulli_layer(lbann_comm *comm, std::vector< int > dims, ProbabilityType prob=0.5)
data_layout
Data layout that is optimized for different modes of parallelism.
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.
int m_expected_num_parent_layers
std::string get_type() const override
Get the layer type's name.