MachineIntelligenceCore:NeuralNets
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
mic::neural_nets::unit_tests Namespace Reference

Classes

class  Conv2x2x2Filter2x1x1s1Double
 Test Fixture - layer of input size 2x2x2 and with filter bank of 2 filters of size 1x1 with stride 1, double. Math example taken from my own calculations;) More...
 
class  Conv3x3x2Filter3x2x2s1Float
 Test Fixture - layer of input size 3x3x2 and with filter bank of 3 filters of size 2x2 with stride 1, floats. Math example taken from my whiteboard;) More...
 
class  Conv4x4x1Filter1x2x2s2Float
 Test Fixture - layer of input size 4x4x1 and with filter bank of 1 filters of size 2x2 with stride 2, floats. Math example taken from my own YET ANOTHER calculations! ech! More...
 
class  Conv4x4x1Filter3x1x1s3Double
 Test Fixture - layer of input size 4x4x1 and with filter bank of 3 filters of size 1x1 with stride 3, double. Math example taken from my own calculations;) More...
 
class  Conv5x5x1Filter1x3x3s1Float
 Test Fixture - layer of input size 5x5x1 and with filter bank of 1 filter of size 3x3 with stride 1 (floats). Math example taken from: https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/. More...
 
class  Conv5x5x1Filter1x2x2s3Float
 Test Fixture - layer of input size 5x5x1 and with filter bank of 1 filter of size 2x2 with stride 3 (float). Math example taken from: https://ujjwalkarn.me/2016/08/11/intuitive-explanation-convnets/. More...
 
class  Conv7x7x3Filter3x3x3s2Float
 Test Fixture - layer of input size 7x7x3 and with filter bank of 2 filters of 3x3 with stride 2 (floats). Math example taken from: http://cs231n.github.io/convolutional-networks/. More...
 
class  Conv5x6x1Filter1x4x4s1Float
 Test Fixture - layer of input size 5x6x1 and with filter bank of 1 filter of size 4x4 with stride 1, floats. Math example taken from: http://soumith.ch/ex/pages/2014/08/07/why-rotate-weights-convolution-gradient/. More...
 
class  Conv28x28x1Filter2x28x28s1Double
 Test Fixture - layer of input size 28x28x1 and with filter bank of 2 filters of size 28x28 with stride 1, double. More...
 
class  Conv8x8x1Filter2x4x4s4Double
 Test Fixture - layer of input size 8x8x1 and with filter bank of 2 filters of size 4x4 with stride 4, double. More...
 
class  Linear1x1Float
 Test Fixture - layer of size 1x1, floats, sets W[0] = 1.0 and b[0] = 1.0. More...
 
class  Linear5x2Float
 Test Fixture - layer of size 5x2, floats. More...
 
class  Linear2x3Float
 Test Fixture - layer of size 2x3, floats, sets all internal and external values. More...
 
class  Linear2x3Double
 Test Fixture - layer of size 2x3, doubles, sets all internal and external values. More...
 
class  Linear50x100Double
 Test Fixture - layer of size 50x100, doubles, randomly sets all internal and external values required for numerical gradient verification. More...
 
class  Simple2LayerRegressionNN
 Test Fixture - simple ff net with 2 layers. More...
 
class  Tutorial2LayerNN
 Test Fixture - feed-forward net with 2 layers. A "formalized" example from a step-by-step tutorial: https://mattmazur.com/2015/03/17/a-step-by-step-backpropagation-example/. More...
 

Functions

 TEST_F (Conv2x2x2Filter2x1x1s1Double, NumericalGradientCheck)
 Numerical gradient test of all parameters for layer of input size 2x2x2 and with filter bank of 2 filters of size 1x1 with stride 1. More...
 
 TEST_F (Conv28x28x1Filter2x28x28s1Double, NumericalGradientCheck)
 Numerical gradient test of all parameters for layer of input size 28x28x1 and with filter bank of 2 filters of size 28x28 with stride 1, double. More...
 
 TEST_F (Conv28x28x1Filter2x28x28s1Double, Convergence)
 
 TEST (Convolutions, LayerDimensions)
 
 TEST_F (Conv2x2x2Filter2x1x1s1Double, Forward)
 
 TEST_F (Conv2x2x2Filter2x1x1s1Double, Backward)
 
 TEST_F (Conv3x3x2Filter3x2x2s1Float, Forward)
 
 TEST_F (Conv4x4x1Filter1x2x2s2Float, Forward)
 
 TEST_F (Conv4x4x1Filter1x2x2s2Float, Backward)
 
 TEST_F (Conv4x4x1Filter3x1x1s3Double, Forward)
 
 TEST_F (Conv4x4x1Filter3x1x1s3Double, Backward)
 
 TEST_F (Conv5x5x1Filter1x3x3s1Float, Dimensions)
 
 TEST_F (Conv5x5x1Filter1x3x3s1Float, Forward)
 
 TEST_F (Conv5x5x1Filter1x2x2s3Float, Forward)
 
 TEST_F (Conv5x5x1Filter1x2x2s3Float, Backward)
 
 TEST_F (Conv5x6x1Filter1x4x4s1Float, Forward)
 
 TEST_F (Conv7x7x3Filter3x3x3s2Float, Forward)
 
 TEST_F (Linear5x2Float, WbInitialization)
 Makes sure that the layer is properly initialized - initial W weights must be non zero and b must be zero. More...
 
 TEST_F (Linear5x2Float, WIsNaN)
 Makes sure that the layer is properly initialized - all W are numbers! More...
 
 TEST_F (Linear5x2Float, WIsNotInf)
 Makes sure that the layer is properly initialized - all W are finite. More...
 
 TEST_F (Linear5x2Float, WAreDifferent)
 Makes sure that the layer is properly initialized and all W are different. More...
 
 TEST_F (Linear1x1Float, Forward_y)
 Makes sure that the layer calculates y = w*x + b, size of layer: is 1x1. More...
 
 TEST_F (Linear2x3Float, Forward_y)
 Makes sure that the layer calculates y = w*x + b, size of layer: is 2x3. More...
 
 TEST (LinearStacked1x2x3Float, Forward_y)
 Makes sure that the two stacked layers will return right result. More...
 
 TEST (Linear2x1Float, Backward_dx)
 Tests backward pass in the y = w*x + b, size of layer: is 2x1. More...
 
 TEST_F (Linear2x3Float, Backward_dx)
 Tests backward pass in the y = w*x + b (dx gradient), size of layer: is 2x3. More...
 
 TEST_F (Linear2x3Float, Backward_dWdb)
 Tests gradients dW and db, size of layer is 2x3. More...
 
 TEST_F (Linear2x3Double, NumericalGradientCheck_dW)
 Numerical gradient test dW, size of layer is 2x3. More...
 
 TEST_F (Linear2x3Double, NumericalGradientCheck_db)
 Numerical gradient test db, size of layer is 2x3. More...
 
 TEST_F (Linear2x3Double, NumericalGradientCheck_dx)
 Numerical gradient test dx, size of layer is 2x3. More...
 
 TEST_F (Linear50x100Double, NumericalGradientCheck_dW)
 Numerical gradient test dW, size of layer is 50x100. More...
 
 TEST_F (Linear50x100Double, NumericalGradientCheck_db)
 Numerical gradient test db, size of layer is 50x100. More...
 
 TEST_F (Linear50x100Double, NumericalGradientCheck_dx)
 Numerical gradient test dx, size of layer is 50x100. More...
 
 TEST_F (Simple2LayerRegressionNN, Dimensions)
 
 TEST_F (Simple2LayerRegressionNN, BatchResize)
 
 TEST_F (Simple2LayerRegressionNN, Serialization)
 
 TEST_F (Tutorial2LayerNN, BackpropagationSingleStep)
 
 TEST_F (Tutorial2LayerNN, TrainSingleStep)
 

Function Documentation

mic::neural_nets::unit_tests::TEST ( Convolutions  ,
LayerDimensions   
)

Checks numbers of receptive fields for different strides.

Author
tkornuta

Definition at line 33 of file Convolution_tests.cpp.

References mic::mlnn::Layer< eT >::output_height, mic::mlnn::Layer< eT >::output_width, and mic::mlnn::Layer< eT >::s.

mic::neural_nets::unit_tests::TEST ( LinearStacked1x2x3Float  ,
Forward_y   
)

Makes sure that the two stacked layers will return right result.

Author
tkornuta

Definition at line 101 of file Linear_tests.cpp.

References mic::mlnn::fully_connected::Linear< eT >::forward(), and mic::mlnn::Layer< eT >::p.

Here is the call graph for this function:

mic::neural_nets::unit_tests::TEST ( Linear2x1Float  ,
Backward_dx   
)

Tests backward pass in the y = w*x + b, size of layer: is 2x1.

Author
tkornuta

Definition at line 127 of file Linear_tests.cpp.

References mic::mlnn::fully_connected::Linear< eT >::backward(), and mic::mlnn::Layer< eT >::p.

Here is the call graph for this function:

mic::neural_nets::unit_tests::TEST_F ( Simple2LayerRegressionNN  ,
Dimensions   
)

Tests the dimensionality of nn.

Definition at line 32 of file MultiLayerNeuralNetworkTests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear5x2Float  ,
WbInitialization   
)

Makes sure that the layer is properly initialized - initial W weights must be non zero and b must be zero.

Author
tkornuta

Definition at line 33 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv2x2x2Filter2x1x1s1Double  ,
NumericalGradientCheck   
)

Numerical gradient test of all parameters for layer of input size 2x2x2 and with filter bank of 2 filters of size 1x1 with stride 1.

Author
tkornuta

Definition at line 34 of file Convolution_convergence_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear5x2Float  ,
WIsNaN   
)

Makes sure that the layer is properly initialized - all W are numbers!

Author
tkornuta

Definition at line 45 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Simple2LayerRegressionNN  ,
BatchResize   
)

Tests the batch resizing.

Definition at line 51 of file MultiLayerNeuralNetworkTests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear5x2Float  ,
WIsNotInf   
)

Makes sure that the layer is properly initialized - all W are finite.

Author
tkornuta

Definition at line 54 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear5x2Float  ,
WAreDifferent   
)

Makes sure that the layer is properly initialized and all W are different.

Author
tkornuta

Definition at line 64 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Simple2LayerRegressionNN  ,
Serialization   
)

Tests squared error loss function on vectors with four floats.

Definition at line 68 of file MultiLayerNeuralNetworkTests.cpp.

References fileName, and mic::mlnn::MultiLayerNeuralNetwork< eT >::load().

Here is the call graph for this function:

mic::neural_nets::unit_tests::TEST_F ( Linear1x1Float  ,
Forward_y   
)

Makes sure that the layer calculates y = w*x + b, size of layer: is 1x1.

Author
tkornuta

Definition at line 76 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv2x2x2Filter2x1x1s1Double  ,
Forward   
)

Checks whether the forward is working for layer of input size 2x2x2 and with filter bank of 2 filters of size 1x1 with stride 1.

Author
tkornuta

Definition at line 78 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv28x28x1Filter2x28x28s1Double  ,
NumericalGradientCheck   
)

Numerical gradient test of all parameters for layer of input size 28x28x1 and with filter bank of 2 filters of size 28x28 with stride 1, double.

Author
tkornuta

Definition at line 84 of file Convolution_convergence_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear2x3Float  ,
Forward_y   
)

Makes sure that the layer calculates y = w*x + b, size of layer: is 2x3.

Author
tkornuta

Definition at line 90 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Tutorial2LayerNN  ,
BackpropagationSingleStep   
)

Tests a single iteration of a backpropagation algorithm.

Definition at line 100 of file MultiLayerNeuralNetworkTests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv2x2x2Filter2x1x1s1Double  ,
Backward   
)

Checks whether the backward pass is working for layer of input size 2x2x2 and with filter bank of 2 filters of size 1x1 with stride 1.

Author
tkornuta

Definition at line 102 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv28x28x1Filter2x28x28s1Double  ,
Convergence   
)

Checks convergence of layer of input size 28x28x1 and with filter bank of 2 filters of size 28x28 with stride 1, double.

Author
tkornuta

Definition at line 134 of file Convolution_convergence_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv3x3x2Filter3x2x2s1Float  ,
Forward   
)

Checks whether the forward is working for layer of input size 3x3x2 and with filter bank of 3 filters of size 2x2 with stride 1.

Author
tkornuta

Definition at line 139 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear2x3Float  ,
Backward_dx   
)

Tests backward pass in the y = w*x + b (dx gradient), size of layer: is 2x3.

Author
tkornuta

Definition at line 146 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear2x3Float  ,
Backward_dWdb   
)

Tests gradients dW and db, size of layer is 2x3.

Author
tkornuta

Definition at line 158 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv4x4x1Filter1x2x2s2Float  ,
Forward   
)

Checks whether the forward is working for layer of input size 4x4x1 and with filter bank of 1 filters of size 2x2 with stride 2.

Author
tkornuta

Definition at line 158 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Tutorial2LayerNN  ,
TrainSingleStep   
)

Tests a single iteration of a backpropagation algorithm.

Definition at line 165 of file MultiLayerNeuralNetworkTests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv4x4x1Filter1x2x2s2Float  ,
Backward   
)

Checks whether the backward gradient pass is working for layer of input size 4x4x1 and with filter bank of 1 filters of size 2x2 with stride 2.

Author
tkornuta

Definition at line 174 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear2x3Double  ,
NumericalGradientCheck_dW   
)

Numerical gradient test dW, size of layer is 2x3.

Author
tkornuta

Definition at line 182 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv4x4x1Filter3x1x1s3Double  ,
Forward   
)

Checks whether the forward is working for layer of input size 4x4x1 and with filter bank of 3 filters of size 1x1 with stride 3, double.

Author
tkornuta

Definition at line 200 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear2x3Double  ,
NumericalGradientCheck_db   
)

Numerical gradient test db, size of layer is 2x3.

Author
tkornuta

Definition at line 208 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv4x4x1Filter3x1x1s3Double  ,
Backward   
)

Checks whether the backward gradient pass is working for layer of input size 4x4x1 and with filter bank of 3 filters of size 1x1 with stride 3, double.

Author
tkornuta

Definition at line 216 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear2x3Double  ,
NumericalGradientCheck_dx   
)

Numerical gradient test dx, size of layer is 2x3.

Author
tkornuta

Definition at line 232 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv5x5x1Filter1x3x3s1Float  ,
Dimensions   
)

Checks whether dimensions of xs, outputs and filters are ok. Convolutional dimensions are nicely explained in this lecture: http://cs231n.github.io/convolutional-networks/

Author
tkornuta

Definition at line 243 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear50x100Double  ,
NumericalGradientCheck_dW   
)

Numerical gradient test dW, size of layer is 50x100.

Author
tkornuta

Definition at line 256 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv5x5x1Filter1x3x3s1Float  ,
Forward   
)

Checks whether the forward is working for layer of input size 5x5x1 and with filter bank of 1 filter of size 3x3 with stride 1.

Author
tkornuta

Definition at line 268 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv5x5x1Filter1x2x2s3Float  ,
Forward   
)

Checks whether the forward is working for layer of input size 5x5x1 and with filter bank of 1 filter of size 2x2 with stride 3 (float).

Author
tkornuta

Definition at line 284 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear50x100Double  ,
NumericalGradientCheck_db   
)

Numerical gradient test db, size of layer is 50x100.

Author
tkornuta

Definition at line 285 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv5x5x1Filter1x2x2s3Float  ,
Backward   
)

Checks whether the backward gradient pass is working for layer of input size 4x4x1 and with filter bank of 3 filters of size 1x1 with stride 3, double.

Author
tkornuta

Definition at line 300 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Linear50x100Double  ,
NumericalGradientCheck_dx   
)

Numerical gradient test dx, size of layer is 50x100.

Author
tkornuta

Definition at line 313 of file Linear_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv5x6x1Filter1x4x4s1Float  ,
Forward   
)

Checks whether the forward is working for layer of input size 5x6x1 and with filter bank of 1 filter of size 4x4 with stride 1.

Author
tkornuta

Definition at line 324 of file Convolution_tests.cpp.

mic::neural_nets::unit_tests::TEST_F ( Conv7x7x3Filter3x3x3s2Float  ,
Forward   
)

Checks whether the forward is working for layer of input size 7x7x3 and with filter bank of 3 filters of 3x3 size with stride 2.

Author
tkornuta

Definition at line 342 of file Convolution_tests.cpp.