Vanillix Module
Vanillix
Bases: BasePipeline
Vanillix specific version of the BasePipeline class.
Inherits preprocess, fit, predict, evaluate, and visualize methods from BasePipeline. This class extends BasePipeline. See the parent class for a full list of attributes and methods.
Additional Attributes
_default_config: Is set to VanillixConfig here.
Source code in src/autoencodix/vanillix.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
__init__(data=None, trainer_type=GeneralTrainer, dataset_type=NumericDataset, model_type=VanillixArchitecture, loss_type=VanillixLoss, preprocessor_type=GeneralPreprocessor, visualizer=GeneralVisualizer, evaluator=GeneralEvaluator, result=None, datasplitter_type=DataSplitter, custom_splits=None, config=None, ontologies=None)
Initialize Vanillix pipeline with customizable components.
Some components are passed as types rather than instances because they require data that is only available after preprocessing.
See implementation of parent class for list of full Args.
Source code in src/autoencodix/vanillix.py
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 | |
sample_latent_space(n_samples, split='test', epoch=-1)
Samples latent space points from the empirical latent distribution.
This method draws new latent points by fitting a diagonal Gaussian distribution to the latent codes of the specified split and epoch, and sampling from it. This enables approximate generative sampling for autoencoders that do not model uncertainty explicitly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_samples
|
int
|
The number of latent points to sample. Must be a positive integer. |
required |
split
|
str
|
The split to sample from (train, valid, test), default is test. |
'test'
|
epoch
|
int
|
The epoch to sample from, default is the last epoch (-1). |
-1
|
Returns:
| Name | Type | Description |
|---|---|---|
z |
Tensor
|
torch.Tensor - The sampled latent space points. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the model has not been trained, latent codes have not been computed, or n_samples is not a positive integer. |
TypeError
|
If the stored latent codes are not numpy arrays. |
Source code in src/autoencodix/vanillix.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |