c98390a27a
Signed-off-by: Serhii Shepel <9946053+sshepel@users.noreply.github.com> |
||
---|---|---|
.. | ||
src/test | ||
pom.xml | ||
readme.md |
readme.md
#DL4J Integration Tests
These tests are designed to check a number of aspects of DL4J:
- Predictions
- Training (training curves, parameters, gradient calculation)
- Evaluation
- Model serialization
- Overfitting sanity checks
- Data pipelines
- Evaluation classes
- Parallel Wrapper
- Validating conditions that should always hold (frozen layer params don't change, for example)
They are designed for the following purposes:
- Detecting regressions: i.e., new commit changed or broke previously working functionality
- Detecting integration issues - i.e., issues that show up only when components are used together (but not in isolation in unit test)
- Detecting significant differences between CPU and CUDA backends
- Validating implementation via sanity checks on training - i.e., can we overfit a single example?
- Checking networks and data pipelines on real-world scale data and nets
- Operating as fully automated pre-release checks (replacing previously used manual checks)
Types of Tests
The integration tests are set up to be able to run multiple tests on each network configuration.
Networks may be pretrained (from model zoo) or randomly initialized (from specified configuration).
Specifically, test cases can be run with any subset of the following components to be tested, by setting TestCase.XYZ boolean options to true or false:
- testPredictions: Testing output (predictions) on some specified data vs. saved/known good arrays
- testGradients: Testing gradients on some specified data vs. saved/known good arrays
- testPretrain: Test layerwise pretraining parameters and training curves
- testTrainingCurves: Train, and check score vs. iteration
- testParamsPostTraining: validate params match post training
- testEvaluation: test the evaluation performance (post training, if 4 or 5 are true)
- testParallelInference: validate that single net and parallel inference results match
- testOverfitting: sanity check - try to overfit a single example
Adding a New Integration Test
The process to add a new test is simple:
- Add a method that creates and returns a TestCase object
- Add it as a unit test to IntegrationTests class
- Run IntegrationTestBaselineGenerator (if required) to generate and save the "known good" results.
Note that IntegrationTestBaselineGenerator assumes you have the dl4j-test-resources cloned parallel to the DL4J mono-repo.