Poplar and PopLibs
RandomGen.hpp
Go to the documentation of this file.
1// Copyright (c) 2017 Graphcore Ltd. All rights reserved.
7#ifndef poprand_RandomGen_hpp
8#define poprand_RandomGen_hpp
9
11#include <array>
12#include <cmath>
13#include <cstdint>
14#include <poplar/Graph.hpp>
15#include <poplar/Program.hpp>
16#include <string>
17#include <utility>
18
19namespace poprand {
20
49 const uint32_t seedModifier, const poplar::Tensor &input,
50 const poplar::Tensor &reference, double keepProbability,
51 double scale, poplar::program::Sequence &prog,
52 const poplar::DebugContext &debugContext = {});
53
84 const uint32_t seedModifier, const poplar::Tensor &input,
85 const poplar::Tensor &reference, double keepProbability,
86 double scale, bool outputClonesRef,
88 const poplar::DebugContext &debugContext = {});
89
122 const uint32_t seedModifier,
123 const poplar::Tensor &input,
124 const poplar::Tensor &reference,
125 double keepProbability, double scale,
127 const poplar::DebugContext &debugContext = {});
128
158 uint32_t seedModifier, const poplar::Tensor &reference,
159 const poplar::Type &outType, double minVal,
160 double maxVal, poplar::program::Sequence &prog,
161 const poplar::DebugContext &debugContext = {});
162
205 uint32_t seedModifier,
206 const poplar::Tensor &reference,
207 const poplar::Type &outType, double minVal,
208 double maxVal, poplar::program::Sequence &prog,
209 double base = M_E,
210 const poplar::DebugContext &debugContext = {});
211
234 uint32_t seedModifier, const poplar::Tensor &reference,
235 const poplar::Type &outType, double prob,
237 const poplar::DebugContext &debugContext = {});
238
263 uint32_t seedModifier, const poplar::Tensor &reference,
264 const poplar::Type &outType, double mean, double stdDev,
266 const poplar::DebugContext &debugContext = {});
267
296 uint32_t seedModifier,
297 const poplar::Tensor &reference,
298 const poplar::Type &outType, double mean,
299 double stdDev, double alpha,
301 const poplar::DebugContext &debugContext = {});
302
312void setSeed(poplar::Graph &graph, const poplar::Tensor &masterSeed,
313 uint32_t seedModifier, poplar::program::Sequence &prog,
314 const poplar::DebugContext &debugContext = {});
315
316} // namespace poprand
317
318#endif // poprand_RandomGen_hpp
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 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
Pseudo-random number generator (PRNG) functions.
Definition: codelets.hpp:8
poplar::Tensor truncatedNormal(poplar::Graph &graph, const poplar::Tensor *seed, uint32_t seedModifier, const poplar::Tensor &reference, const poplar::Type &outType, double mean, double stdDev, double alpha, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Truncated normal distribution.
poplar::Tensor dropout(poplar::Graph &graph, const poplar::Tensor *seed, const uint32_t seedModifier, const poplar::Tensor &input, const poplar::Tensor &reference, double keepProbability, double scale, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Apply dropout to a tensor.
poplar::Tensor normal(poplar::Graph &graph, const poplar::Tensor *seed, uint32_t seedModifier, const poplar::Tensor &reference, const poplar::Type &outType, double mean, double stdDev, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Normal distribution with given mean and standard deviation.
poplar::Tensor logUniform(poplar::Graph &graph, const poplar::Tensor *seed, uint32_t seedModifier, const poplar::Tensor &reference, const poplar::Type &outType, double minVal, double maxVal, poplar::program::Sequence &prog, double base=M_E, const poplar::DebugContext &debugContext={})
Log-uniform distribution over a closed interval [minVal, maxVal].
poplar::Tensor bernoulli(poplar::Graph &graph, const poplar::Tensor *seed, uint32_t seedModifier, const poplar::Tensor &reference, const poplar::Type &outType, double prob, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Bernoulli distribution which has the value 1 with the specified probability.
poplar::Tensor shapedDropout(poplar::Graph &graph, const poplar::Tensor *seed, const uint32_t seedModifier, const poplar::Tensor &input, const poplar::Tensor &reference, double keepProbability, double scale, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Apply shaped dropout to a tensor.
poplar::Tensor uniform(poplar::Graph &graph, const poplar::Tensor *seed, uint32_t seedModifier, const poplar::Tensor &reference, const poplar::Type &outType, double minVal, double maxVal, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Uniform distribution in a given interval with maxVal > minVal.
void setSeed(poplar::Graph &graph, const poplar::Tensor &masterSeed, uint32_t seedModifier, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Sets the random number generator seed on all tiles.
Define a PopLibs exception.