Caffe2 - Python API
A deep learning, cross platform ML framework
Classes | Functions | Variables
test_distributions Namespace Reference

Classes

class  TestAgainstScipy
 
class  TestConstraintRegistry
 
class  TestConstraints
 
class  TestDistributions
 
class  TestDistributionShapes
 
class  TestJit
 
class  TestKL
 
class  TestLazyLogitsInitialization
 
class  TestNumericalStability
 
class  TestRsample
 
class  TestTransforms
 
class  TestValidation
 

Functions

def pairwise (Dist, params)
 
def is_all_nan (tensor)
 

Variables

 load_tests = load_tests
 
bool TEST_NUMPY = True
 
 Example = namedtuple('Example', ['Dist', 'params'])
 
list EXAMPLES
 
list BAD_EXAMPLES
 

Detailed Description

Note [Randomized statistical tests]
-----------------------------------

This note describes how to maintain tests in this file as random sources
change. This file contains two types of randomized tests:

1. The easier type of randomized test are tests that should always pass but are
   initialized with random data. If these fail something is wrong, but it's
   fine to use a fixed seed by inheriting from common.TestCase.

2. The trickier tests are statistical tests. These tests explicitly call
   set_rng_seed(n) and are marked "see Note [Randomized statistical tests]".
   These statistical tests have a known positive failure rate
   (we set failure_rate=1e-3 by default). We need to balance strength of these
   tests with annoyance of false alarms. One way that works is to specifically
   set seeds in each of the randomized tests. When a random generator
   occasionally changes (as in #4312 vectorizing the Box-Muller sampler), some
   of these statistical tests may (rarely) fail. If one fails in this case,
   it's fine to increment the seed of the failing test (but you shouldn't need
   to increment it more than once; otherwise something is probably actually
   wrong).

Function Documentation

def test_distributions.is_all_nan (   tensor)
Checks if all entries of a tensor is nan.

Definition at line 86 of file test_distributions.py.

def test_distributions.pairwise (   Dist,
  params 
)
Creates a pair of distributions `Dist` initialzed to test each element of
param with each other.

Definition at line 76 of file test_distributions.py.