Test
This class is designed for testing and visualizing synthetic images generated by the Generator model.
| Attributes: |
|
|---|
Methods:
| Name | Description |
|---|---|
get_the_best_model |
Loads the best performing generator model from a predefined directory. |
test |
Generates and visualizes synthetic images using the generator model. |
Source code in test.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
__init__(num_samples=20, image_size=64, latent_space=100, device='cpu')
Initializes the Test class with the specified configuration.
| Parameters: |
|
|---|
Source code in test.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
get_the_best_model()
Searches for and loads the best performing generator model from a specified directory.
| Raises: |
|
|---|
Source code in test.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
test()
Generates synthetic images using the best generator model and visualizes them.
This method also attempts to save the generated images to a file and logs any exceptions encountered.
Source code in test.py
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |