ConvParams
#include <poplin/ConvParams.hpp>
Data types for convolution parameters.
-
template<>
struct hash<poplin::ConvParams::InputTransform> Public Functions
-
std::size_t operator()(const poplin::ConvParams::InputTransform &it) const
-
std::size_t operator()(const poplin::ConvParams::InputTransform &it) const
-
template<>
struct hash<poplin::ConvParams::OutputTransform> Public Functions
-
std::size_t operator()(const poplin::ConvParams::OutputTransform &ot) const
-
std::size_t operator()(const poplin::ConvParams::OutputTransform &ot) const
-
template<>
struct hash<poplin::ConvParams> Public Functions
-
std::size_t operator()(const poplin::ConvParams ¶ms) const
-
std::size_t operator()(const poplin::ConvParams ¶ms) const
-
namespace poplin
Linear algebra functions.
Decomposition of a matrix into an lower triangular matrix L and upper triangular matrix U.
Functions
-
std::ostream &operator<<(std::ostream &os, const ConvParams &p)
-
std::istream &operator>>(std::istream &is, ConvParams &p)
-
std::size_t hash_value(const ConvParams::InputTransform &it)
-
std::size_t hash_value(const ConvParams::OutputTransform &ot)
-
struct ConvParams
Public Functions
-
ConvParams() = default
-
ConvParams(poplar::Type dataType, std::size_t batchSize, std::vector<std::size_t> inputFieldShape, std::vector<std::size_t> kernelShape, std::size_t inputChannels, std::size_t outputChannels, std::size_t numConvGroups)
-
ConvParams(poplar::Type inputType, poplar::Type outputType, std::size_t batchSize, std::vector<std::size_t> inputFieldShape, std::vector<std::size_t> kernelShape, std::size_t inputChannels, std::size_t outputChannels, std::size_t numConvGroups)
-
ConvParams(poplar::Type inputType, poplar::Type outputType, std::size_t batchSize, std::vector<std::size_t> inputFieldShape, std::vector<std::size_t> kernelShape, std::size_t inputChannels, std::size_t outputChannels, std::size_t numConvGroups, InputTransform inputTransform, InputTransform kernelTransform, OutputTransform outputTransform)
-
std::size_t getUntransformedOutputSize(unsigned dim) const
Return the size of the output of the convolution operation, before output transformations are applied.
-
inline std::size_t getNumOutputChansPerConvGroup() const
Return the number of output channels per group.
-
inline std::size_t getNumInputChansPerConvGroup() const
Return the number of input channels per group.
-
unsigned getTruncatedInputSize(unsigned dim) const
Return the size of input in the specified dimension after truncation.
-
unsigned getTruncatedKernelSize(unsigned dim) const
Return the size of kernel in the specified dimension after truncation.
-
unsigned getTransformedInputSize(unsigned dim) const
Return the size of input in the specified dimension after applying the input transforms.
-
unsigned getTransformedKernelSize(unsigned dim) const
Return the size of kernel in the specified dimension after applying the kernel transforms.
-
void validate() const
-
ConvParams canonicalize() const
Public Members
-
std::size_t numConvGroups
Number of groups in a grouped convolution (G).
The input and output channels are divided by G such that G kernels are applied to an input tensors of size [B, O{dims}, Ci/G] to produce output tensors of size [B, O{dims}, Co/G]. O{dims} is the output field dimensions.
-
InputTransform inputTransform
The transform applied to the input.
-
InputTransform kernelTransform
The transform applied to the kernel.
-
OutputTransform outputTransform
The transform applied to the output.
Friends
-
friend bool operator<(const ConvParams &a, const ConvParams &b)
-
friend bool operator==(const ConvParams &a, const ConvParams &b)
-
friend bool operator!=(const ConvParams &a, const ConvParams &b)
-
struct InputTransform
Public Functions
-
InputTransform() = default
-
InputTransform(std::vector<unsigned> truncationLower, std::vector<unsigned> truncationUpper, std::vector<unsigned> dilation, std::vector<unsigned> paddingLower, std::vector<unsigned> paddingUpper, std::vector<bool> flip)
- Parameters
truncationLower – Where to truncate the lower end of each dimension.
truncationUpper – Where to truncate the upper end of each dimension.
dilation – Dilation to apply to each dimension.
paddingLower – How much to pad the lower end of each dimension.
paddingUpper – How much to pad the upper end of each dimension.
flip – If true, each spatial dimension is flipped after being padded.
Public Members
-
std::vector<unsigned> truncationLower
The position where the lower end of each spatial dimension is truncated before dilation.
-
std::vector<unsigned> truncationUpper
The position where the upper end of each spatial dimension is truncated before dilation.
-
std::vector<unsigned> dilation
Dilation applied to each spatial dimensions after truncation and before padding.
Dilation is performed by placing a number of zeroed elements between the elements of the field.
-
std::vector<unsigned> paddingLower
Padding applied to each spatial dimension after dilation and before flipping.
Friends
-
friend bool operator<(const InputTransform &a, const InputTransform &b)
-
friend bool operator==(const InputTransform &a, const InputTransform &b)
-
friend bool operator!=(const InputTransform &a, const InputTransform &b)
-
InputTransform() = default
-
struct OutputTransform
Public Functions
-
OutputTransform() = default
-
OutputTransform(std::vector<unsigned> truncationLower, std::vector<unsigned> truncationUpper, std::vector<unsigned> striding, std::vector<unsigned> paddingLower, std::vector<unsigned> paddingUpper)
- Parameters
truncationLower – Where to truncate the lower end of each dimension.
truncationUpper – Where to truncate the upper end of each dimension.
striding – Stride to use in convolution.
paddingLower – How much to pad the lower end of each dimension.
paddingUpper – How much to pad the upper end of each dimension.
Public Members
-
std::vector<unsigned> truncationLower
The position where the lower end of each spatial dimension is truncated before dilation.
-
std::vector<unsigned> truncationUpper
The position where the upper end of each spatial dimension is truncated before dilation.
-
std::vector<unsigned> stride
Striding applied to each spatial dimension after truncation and before padding.
Friends
-
friend bool operator<(const OutputTransform &a, const OutputTransform &b)
-
friend bool operator==(const OutputTransform &a, const OutputTransform &b)
-
friend bool operator!=(const OutputTransform &a, const OutputTransform &b)
-
OutputTransform() = default
-
ConvParams() = default
-
std::ostream &operator<<(std::ostream &os, const ConvParams &p)
-
namespace std
- template<> ConvParams >
Public Functions
-
std::size_t operator()(const poplin::ConvParams ¶ms) const
-
std::size_t operator()(const poplin::ConvParams ¶ms) const
- template<> InputTransform >
Public Functions
-
std::size_t operator()(const poplin::ConvParams::InputTransform &it) const
-
std::size_t operator()(const poplin::ConvParams::InputTransform &it) const
- template<> OutputTransform >
Public Functions
-
std::size_t operator()(const poplin::ConvParams::OutputTransform &ot) const
-
std::size_t operator()(const poplin::ConvParams::OutputTransform &ot) const