8#ifndef poplin_Norms_hpp
9#define poplin_Norms_hpp
11#include <poplar/Graph.hpp>
12#include <poplar/Program.hpp>
88std::pair<poplar::Tensor, poplar::Tensor>
120std::pair<poplar::Tensor, poplar::Tensor>
123 bool unbiasedVarEstimate,
bool stableAlgo =
false,
147 const std::vector<poplar::Tensor> &inputsToReduce,
249std::pair<poplar::Tensor, poplar::Tensor>
DebugContext gathers the common external parameters of the context of an operation.
Definition: DebugContext.hpp:221
This class represents a graph program to be executed on the IPU.
Definition: Graph.hpp:52
A set of option/value string flags to be used in various APIs.
Definition: OptionFlags.hpp:24
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Class representing device data types.
Definition: Type.hpp:42
Program that executes a sequence of programs.
Definition: Program.hpp:77
Type FLOAT
Device type: float
Linear algebra functions.
Definition: Cholesky.hpp:14
poplar::Tensor 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.
poplar::Tensor 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 distri...
poplar::Tensor 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.
std::pair< poplar::Tensor, poplar::Tensor > createNormParams(poplar::Graph &graph, const poplar::Tensor &acts, const poplar::DebugContext &debugContext={})
Creates a tensor pair of normalisation parameters (gamma, beta).
std::pair< poplar::Tensor, poplar::Tensor > 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 m...
std::pair< poplar::Tensor, poplar::Tensor > 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.
poplar::Tensor 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.
poplar::Tensor 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 l...
poplar::Tensor 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 convol...
poplar::Tensor 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.
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)> DistributedNormReduceCallback
Callback to reduce statistics and gradients.
Definition: Norms.hpp:150
std::pair< poplar::Tensor, poplar::Tensor > 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.