Back to index

python-biopython  1.60
Public Member Functions
test_NNGeneral.StopTrainingTest Class Reference

List of all members.

Public Member Functions

def test_validation_increase_stop

Detailed Description

Test functionality for stopping training networks.

Definition at line 16 of file test_NNGeneral.py.


Member Function Documentation

Stop training when the ValidationExamples increase.

Definition at line 19 of file test_NNGeneral.py.

00019 
00020     def test_validation_increase_stop(self):
00021         """Stop training when the ValidationExamples increase.
00022         """
00023         stopper = ValidationIncreaseStop(max_iterations = 20,
00024                                          min_iterations = 2)
00025 
00026         stopper.last_error = 1.0
00027         do_stop = stopper.stopping_criteria(5, 1.0, 1.5)
00028         assert do_stop == 1, \
00029                "Did not tell us to stop when validation error increased."
00030 
00031         stopper.last_error = 1.0
00032         do_stop = stopper.stopping_criteria(1, 1.0, 1.5)
00033         assert do_stop == 0, \
00034                "Told us to stop before we reached the minimum iterations."
00035 
00036         stopper.last_error = 1.0
00037         do_stop = stopper.stopping_criteria(25, 1.0, 0.5)
00038         assert do_stop == 1, \
00039                "Did not tell us to stop when reaching maximum iterations."
00040 


The documentation for this class was generated from the following file: