8#ifndef popnn_CTCLoss_hpp
9#define popnn_CTCLoss_hpp
13#include <poplar/Graph.hpp>
14#include <poplar/OptionFlags.hpp>
15#include <poplar/Program.hpp>
52 const poplar::Type &outType,
unsigned batchSize,
unsigned maxTime,
53 unsigned maxLabelLength,
unsigned numClasses,
71 const std::size_t batchSize,
72 const std::size_t maxTime,
73 const std::size_t numClasses,
const Plan &plan,
89 const std::size_t batchSize,
90 const std::size_t maxLabelLength,
std::pair< poplar::Tensor, poplar::Tensor > calcLossAndGradientLogits(poplar::Graph &graph, const poplar::Type &outType, const poplar::Tensor &logits, const poplar::Tensor &labels, const poplar::Tensor &dataLengths, const poplar::Tensor &labelLengths, poplar::program::Sequence &prog, const unsigned blankClass, const Plan &plan, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Calculate the CTC loss & gradient, creating and mapping the result tensor according to the plan provi...
poplar::Tensor calcCTCLossLogProbabilities(poplar::Graph &graph, const poplar::Type &outType, const poplar::Tensor &logProbs, const poplar::Tensor &labels, const poplar::Tensor &dataLengths, const poplar::Tensor &labelLengths, poplar::program::Sequence &prog, const unsigned blankClass, const Plan &plan, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Calculate the CTC loss, creating and mapping the result tensor according to the plan provided.
poplar::Tensor calcCTCLossLogits(poplar::Graph &graph, const poplar::Type &outType, const poplar::Tensor &logits, const poplar::Tensor &labels, const poplar::Tensor &dataLengths, const poplar::Tensor &labelLengths, poplar::program::Sequence &prog, const unsigned blankClass, const Plan &plan, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Calculate the CTC loss, creating and mapping the result tensor according to the plan provided.
std::pair< poplar::Tensor, poplar::Tensor > calcLossAndGradientLogProbabilities(poplar::Graph &graph, const poplar::Type &outType, const poplar::Tensor &logProbs, const poplar::Tensor &labels, const poplar::Tensor &dataLengths, const poplar::Tensor &labelLengths, poplar::program::Sequence &prog, const unsigned blankClass, const Plan &plan, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Calculate the CTC loss & gradient, creating and mapping the result tensor according to the plan provi...
poplar::Tensor createLabelsInput(poplar::Graph &graph, const poplar::Type &type, const std::size_t batchSize, const std::size_t maxLabelLength, const Plan &plan, const poplar::DebugContext &debugContext={})
Create and map a labels input [batchSize, maxLabelLength] tensor which the gradient function will use...
Support for planning Connectionist Temporal Classification (CTC) Operations.
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
An object representing a plan that describes how to map tensors and implement the CTC Loss or CTC Inf...
Definition: CTCPlan.hpp:19
Functions used in neural networks.
Definition: BatchNorm.hpp:14