|
LBANN
0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
|
#include <cutout.hpp>
Public Member Functions | |
| cutout (size_t num_holes, size_t length) | |
| transform * | copy () const override |
| std::string | get_type () const override |
| void | apply (utils::type_erased_matrix &data, std::vector< size_t > &dims) override |
Public Member Functions inherited from lbann::transform::transform | |
| transform ()=default | |
| transform (const transform &)=default | |
| transform & | operator= (const transform &)=default |
| virtual | ~transform ()=default |
| virtual description | get_description () const |
| virtual bool | supports_non_inplace () const |
| virtual void | apply (utils::type_erased_matrix &data, CPUMat &out, std::vector< size_t > &dims) |
Private Attributes | |
| size_t | m_num_holes |
| size_t | m_length |
Additional Inherited Members | |
Static Protected Member Functions inherited from lbann::transform::transform | |
| static float | get_uniform_random (float a, float b) |
| static bool | get_bool_random (float p) |
| static El::Int | get_uniform_random_int (El::Int a, El::Int b) |
Cutout data augmentation which randomly masks out square regions of input.
See:
DeVries and Taylor. "Improved Regularization of Convolutional Neural Networks with Cutout". arXiv preprint arXiv:1708.04552 (2017).
This will randomly select a center pixel for each square and set all pixels within that square to 0. It is permissible for portions of the masks to lie outside of the image.
Normalization about 0 should be applied after applying cutout.
Definition at line 51 of file transforms/vision/cutout.hpp.
|
inline |
Cutout with a given number of squares of a given size.
| num_holes | Number of squares to mask out (must be positive). |
| length | Length of a side of the square (must be positive). |
Definition at line 59 of file transforms/vision/cutout.hpp.
|
overridevirtual |
Apply the transform to data.
| data | The input data to transform, which is modified in-place. The matrix shuold be contiguous. |
| dims | The dimensions of the data tensor. For "plain data", dims should have one entry, giving its size. For images, dims should have three entries: channels, height, width. |
Implements lbann::transform::transform.
|
inlineoverridevirtual |
Create a copy of the transform instance.
Implements lbann::transform::transform.
Definition at line 70 of file transforms/vision/cutout.hpp.
|
inlineoverridevirtual |
Human-readable type name.
Implements lbann::transform::transform.
Definition at line 72 of file transforms/vision/cutout.hpp.
|
private |
Length of a side of each square that will be masked out.
Definition at line 81 of file transforms/vision/cutout.hpp.
|
private |
Number of squares that will be masked out.
Definition at line 79 of file transforms/vision/cutout.hpp.