Poplar and PopLibs
|
Functions to support normalising values in a tensor. More...
#include <functional>
#include <poplar/Graph.hpp>
#include <poplar/Program.hpp>
#include <tuple>
Go to the source code of this file.
Namespaces | |
namespace | poplin |
Linear algebra functions. | |
Typedefs | |
using | poplin::DistributedNormReduceCallback = std::function< std::vector< poplar::Tensor >(poplar::Graph &replicatedGraph, const std::vector< poplar::Tensor > &inputsToReduce, poplar::program::Sequence &prog, unsigned groupSize, const poplar::DebugContext &debugContext, const poplar::OptionFlags &options)> |
Callback to reduce statistics and gradients. More... | |
Functions | |
poplar::Tensor | poplin::createNormGamma (poplar::Graph &graph, const poplar::Tensor &acts, const poplar::Type &type, const poplar::DebugContext &debugContext={}) |
Create and map the per-channel multiplicative gamma parameter tensor used for normalisation in convolution layers. More... | |
poplar::Tensor | poplin::createNormGamma (poplar::Graph &graph, const poplar::Tensor &acts, const poplar::DebugContext &debugContext={}) |
Create and map the per-channel multiplicative gamma parameter tensor used for normalisation in convolution layers. More... | |
poplar::Tensor | poplin::createNormBeta (poplar::Graph &graph, const poplar::Tensor &acts, const poplar::Type &type, const poplar::DebugContext &debugContext={}) |
Create and map the per-channel additive beta parameter tensor used for normalisation in convolution layers. More... | |
poplar::Tensor | poplin::createNormBeta (poplar::Graph &graph, const poplar::Tensor &acts, const poplar::DebugContext &debugContext={}) |
Create and map the per-channel additive beta parameter tensor used for normalisation in convolution layers. More... | |
std::pair< poplar::Tensor, poplar::Tensor > | poplin::createNormParams (poplar::Graph &graph, const poplar::Tensor &acts, const poplar::DebugContext &debugContext={}) |
Creates a tensor pair of normalisation parameters (gamma, beta). More... | |
std::pair< poplar::Tensor, poplar::Tensor > | poplin::normStatistics (poplar::Graph &graph, const poplar::Tensor &actsUngrouped, float eps, poplar::program::Sequence &prog, bool unbiasedVarEstimate, bool stableAlgo=false, const poplar::Type &partialsType=poplar::FLOAT, const poplar::DebugContext &debugContext={}) |
Compute the normalisation statistics from the activations tensor. More... | |
std::pair< poplar::Tensor, poplar::Tensor > | poplin::distributedNormStatistics (poplar::Graph &replicatedGraph, const poplar::Tensor &actsUngrouped, float eps, poplar::program::Sequence &prog, bool unbiasedVarEstimate, DistributedNormReduceCallback allReduceCallback, unsigned normSize, bool stableAlgo=false, const poplar::Type &partialsType=poplar::FLOAT, const poplar::DebugContext &debugContext={}) |
Compute the normalisation statistics for a part of the activations tensor which is distributed over multiple replicas. More... | |
poplar::Tensor | poplin::normWhiten (poplar::Graph &graph, const poplar::Tensor &acts, const poplar::Tensor &mean, const poplar::Tensor &iStdDev, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}) |
Compute the whitened activations using the supplied mean and inverse standard deviation. More... | |
poplar::Tensor | poplin::normalise (poplar::Graph &graph, const poplar::Tensor &actsWhitened, const poplar::Tensor &gamma, const poplar::Tensor &beta, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}) |
Computes the normalised output from whitened activations. More... | |
std::pair< poplar::Tensor, poplar::Tensor > | poplin::normParamGradients (poplar::Graph &graph, const poplar::Tensor &actsWhitened, const poplar::Tensor &gradsIn, poplar::program::Sequence &prog, const poplar::Type &partialsType=poplar::FLOAT, const poplar::DebugContext &debugContext={}) |
Compute gradients with respect to parameters required for parameter update. More... | |
poplar::Tensor | poplin::normGradients (poplar::Graph &graph, const poplar::Tensor &gradsIn, const poplar::Tensor &gamma, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}) |
Propagate the gradients through the normalisation layer. More... | |
poplar::Tensor | poplin::normStatisticsGradients (poplar::Graph &graph, const poplar::Tensor &actsWhitened, const poplar::Tensor &gradsIn, const poplar::Tensor &invStdDev, poplar::program::Sequence &prog, const poplar::Type &partialsType=poplar::FLOAT, const poplar::DebugContext &debugContext={}) |
Propagate the gradients through the norm statistics layer. More... | |
poplar::Tensor | poplin::distributedNormStatisticsGradients (poplar::Graph &replicatedGraph, const poplar::Tensor &actsWhitened, const poplar::Tensor &gradsIn, const poplar::Tensor &invStdDev, poplar::program::Sequence &prog, poplin::DistributedNormReduceCallback reduceCallback, unsigned normSize, const poplar::Type &partialsType=poplar::FLOAT, const poplar::DebugContext &debugContext={}) |
Propagate the gradients through the norm statistics layer where equal sized batch elements are distributed over replicas. More... | |
Functions to support normalising values in a tensor.