LBANN  0.103.0
LivermoreBigArtificialNeuralNetworkToolkit
lbann::transform::scale Class Reference

#include <scale.hpp>

Inheritance diagram for lbann::transform::scale:
[legend]
Collaboration diagram for lbann::transform::scale:
[legend]

Public Member Functions

 scale (float scale_val)
 
transformcopy () 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
 
transformoperator= (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

float m_scale
 

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)
 

Detailed Description

Scale data by a constant.

Definition at line 40 of file scale.hpp.

Constructor & Destructor Documentation

◆ scale()

lbann::transform::scale::scale ( float  scale_val)
inline

Scale all data by scale_val.

Definition at line 44 of file scale.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ apply()

void lbann::transform::scale::apply ( utils::type_erased_matrix data,
std::vector< size_t > &  dims 
)
overridevirtual

Apply the transform to data.

Parameters
dataThe input data to transform, which is modified in-place. The matrix shuold be contiguous.
dimsThe 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.
Note
dims is a hack until we have proper tensors.

Implements lbann::transform::transform.

Here is the caller graph for this function:

◆ copy()

transform* lbann::transform::scale::copy ( ) const
inlineoverridevirtual

Create a copy of the transform instance.

Implements lbann::transform::transform.

Definition at line 46 of file scale.hpp.

Here is the call graph for this function:

◆ get_type()

std::string lbann::transform::scale::get_type ( ) const
inlineoverridevirtual

Human-readable type name.

Implements lbann::transform::transform.

Definition at line 48 of file scale.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ m_scale

float lbann::transform::scale::m_scale
private

Amount to scale data by.

Definition at line 55 of file scale.hpp.


The documentation for this class was generated from the following file: